From d1f5c4c1d66601e83e13c891ddfa7d47ffec91cb Mon Sep 17 00:00:00 2001 From: Liam Date: Mon, 30 Sep 2024 07:53:32 +0100 Subject: [PATCH] always sort the history --- src/common/model/player/impl/scoresaber-player.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/common/model/player/impl/scoresaber-player.ts b/src/common/model/player/impl/scoresaber-player.ts index d375a02..2b6390d 100644 --- a/src/common/model/player/impl/scoresaber-player.ts +++ b/src/common/model/player/impl/scoresaber-player.ts @@ -118,12 +118,11 @@ export async function getScoreSaberPlayerFromToken( rank: rank, }; } - - // Sort the fallback history - statisticHistory = Object.entries(statisticHistory) - .sort() - .reduce((obj, [key, value]) => ({ ...obj, [key]: value }), {}); } + // Sort the fallback history + statisticHistory = Object.entries(statisticHistory) + .sort() + .reduce((obj, [key, value]) => ({ ...obj, [key]: value }), {}); const yesterdayDate = formatDateMinimal( getMidnightAlignedDate(getDaysAgoDate(1)), );