From f37e62cd445290a79bb054037050bbf3badabd16 Mon Sep 17 00:00:00 2001 From: Miodec Date: Thu, 15 Jul 2021 15:42:25 +0100 Subject: [PATCH] fixed today tracker including incomplete test seconds when failing a test --- src/js/test/test-logic.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/js/test/test-logic.js b/src/js/test/test-logic.js index 5ba485e5a..c0a3e1bb9 100644 --- a/src/js/test/test-logic.js +++ b/src/js/test/test-logic.js @@ -1253,13 +1253,14 @@ export function finish(difficultyFailed = false) { if (afkSecondsPercent > 0) { $("#result .stats .time .bottom .afk").text(afkSecondsPercent + "% afk"); } - TodayTracker.addSeconds( - testtime + - (TestStats.incompleteSeconds < 0 + let ttseconds = testtime - afkseconds; + if (!difficultyFailed) { + ttseconds += + TestStats.incompleteSeconds < 0 ? 0 - : Misc.roundTo2(TestStats.incompleteSeconds)) - - afkseconds - ); + : Misc.roundTo2(TestStats.incompleteSeconds); + } + TodayTracker.addSeconds(ttseconds); $("#result .stats .time .bottom .timeToday").text(TodayTracker.getString()); $("#result .stats .key .bottom").text(testtime + "s"); $("#words").removeClass("blurred");