Fixed Decimal Bug

This commit is contained in:
Estebene 2021-05-01 21:59:45 +12:00
parent dd33f693ae
commit b28fe166e5
2 changed files with 4 additions and 3 deletions

View file

@ -294,7 +294,6 @@ function handleSpace(event, isEnter) {
return;
} else if (TestLogic.words.currentIndex == TestLogic.words.length) {
//submitted last word that is incorrect
TestStats.setLastSecondNotRound();
TestLogic.finish();
return;
}
@ -674,7 +673,6 @@ function handleAlpha(event) {
TestLogic.input.pushHistory();
TestLogic.corrected.pushHistory();
TestStats.setLastSecondNotRound();
TestLogic.finish();
}
}

View file

@ -949,6 +949,10 @@ export function finish(difficultyFailed = false) {
Keymap.hide();
Funbox.activate("none", null);
if (Misc.roundTo2(TestStats.calculateTestSeconds()) % 1 != 0) {
TestStats.setLastSecondNotRound();
}
if (Config.mode == "zen" || bailout) {
TestStats.removeAfkData();
}
@ -1783,7 +1787,6 @@ export function fail() {
input.pushHistory();
corrected.pushHistory();
TestStats.pushKeypressesToHistory();
TestStats.setLastSecondNotRound();
finish(true);
let testSeconds = TestStats.calculateTestSeconds(performance.now());
let afkseconds = TestStats.calculateAfkSeconds();