reordered function to avoid warning

This commit is contained in:
Jack 2021-03-30 23:31:03 +01:00
parent a7e051461b
commit 1f54d78fde

View file

@ -904,18 +904,6 @@ export function addWord() {
TestUI.addWord(randomWord);
}
export function fail() {
input.pushHistory();
corrected.pushHistory();
TestStats.pushKeypressesToHistory();
TestStats.setLastSecondNotRound();
finish(true);
let testSeconds = TestStats.calculateTestSeconds(performance.now());
let afkseconds = TestStats.calculateAfkSeconds();
TestStats.incrementIncompleteSeconds(testSeconds - afkseconds);
TestStats.incrementRestartCount();
}
export function finish(difficultyFailed = false) {
if (!active) return;
if (Config.mode == "zen" && input.current.length != 0) {
@ -1734,3 +1722,15 @@ export function finish(difficultyFailed = false) {
}
});
}
export function fail() {
input.pushHistory();
corrected.pushHistory();
TestStats.pushKeypressesToHistory();
TestStats.setLastSecondNotRound();
finish(true);
let testSeconds = TestStats.calculateTestSeconds(performance.now());
let afkseconds = TestStats.calculateAfkSeconds();
TestStats.incrementIncompleteSeconds(testSeconds - afkseconds);
TestStats.incrementRestartCount();
}