From 28898fdd566c9f08a437265aa86d24c860680e15 Mon Sep 17 00:00:00 2001 From: Liam Date: Mon, 30 Oct 2023 16:31:52 +0000 Subject: [PATCH] fix ranked scores history --- src/services/updateData.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/services/updateData.ts b/src/services/updateData.ts index f2c5b2b..e89838e 100644 --- a/src/services/updateData.ts +++ b/src/services/updateData.ts @@ -153,6 +153,7 @@ async function updateAverages() { rank: 0, maxCombo: 0, }; + const rankedScores = scores.filter((score) => score.rank); scores.forEach((score) => { if (score.acc) { average.acc += score.acc; @@ -175,8 +176,8 @@ async function updateAverages() { } }); average.acc /= scores.length; - average.pp /= scores.length; - average.stars /= scores.length; + average.pp /= rankedScores.length; + average.stars /= rankedScores.length; average.mistakes.badCuts /= scores.length; average.mistakes.missed /= scores.length; average.rank /= scores.length;