From 3224753e6deb0a08491f26a8c53231942d5eacfe Mon Sep 17 00:00:00 2001 From: Miodec Date: Thu, 15 Jul 2021 17:46:21 +0100 Subject: [PATCH] hopefully fixed the tracker --- src/js/test/test-logic.js | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/js/test/test-logic.js b/src/js/test/test-logic.js index 012759f33..4e8f194b8 100644 --- a/src/js/test/test-logic.js +++ b/src/js/test/test-logic.js @@ -1253,14 +1253,15 @@ export function finish(difficultyFailed = false) { if (afkSecondsPercent > 0) { $("#result .stats .time .bottom .afk").text(afkSecondsPercent + "% afk"); } - let ttseconds = testtime - afkseconds; - // if (!difficultyFailed) { - // ttseconds += - // TestStats.incompleteSeconds < 0 - // ? 0 - // : Misc.roundTo2(TestStats.incompleteSeconds); - // } - TodayTracker.addSeconds(ttseconds); + if (!difficultyFailed) { + TodayTracker.addSeconds( + testtime + + (TestStats.incompleteSeconds < 0 + ? 0 + : Misc.roundTo2(TestStats.incompleteSeconds)) - + afkseconds + ); + } $("#result .stats .time .bottom .timeToday").text(TodayTracker.getString()); $("#result .stats .key .bottom").text(testtime + "s"); $("#words").removeClass("blurred");