mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-12-29 03:20:46 +08:00
fixed today tracker including incomplete test seconds when failing a test
This commit is contained in:
parent
61a90493b9
commit
f37e62cd44
1 changed files with 7 additions and 6 deletions
|
|
@ -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");
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue