From 417a52138d9ae00c1c63b23e9a1e9abf590e2d75 Mon Sep 17 00:00:00 2001 From: spacemeowx2 Date: Mon, 17 Jul 2023 15:33:32 +0800 Subject: [PATCH] fix: skip updateState if history if empty (#81) --- src/RankTracker.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/RankTracker.ts b/src/RankTracker.ts index 145d7a0..241dbb4 100644 --- a/src/RankTracker.ts +++ b/src/RankTracker.ts @@ -347,6 +347,10 @@ export class RankTracker { async updateState( history: HistoryGroups["nodes"], ) { + if (history.length === 0) { + return; + } + // history order by time. 0 is the oldest. const flatten: FlattenItem[] = await Promise.all( history