mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-03-01 01:05:06 +08:00
safety check to stop the test if last word is correct but we are still trying to move on to the next word
This commit is contained in:
parent
540f24dc4f
commit
46f4c69e5f
1 changed files with 7 additions and 0 deletions
|
@ -205,6 +205,11 @@ function handleSpace(): void {
|
|||
Sound.playClick();
|
||||
}
|
||||
Replay.addReplayEvent("submitCorrectWord");
|
||||
if (TestWords.words.currentIndex === TestWords.words.length) {
|
||||
//submitted last word (checking this in case the test doesnt stop automatically on correct last keypress)
|
||||
TestLogic.finish();
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if (!nospace) {
|
||||
if (!Config.playSoundOnError || Config.blindMode) {
|
||||
|
@ -1159,6 +1164,8 @@ $("#wordsInput").on("input", (event) => {
|
|||
return;
|
||||
}
|
||||
|
||||
console.log("input", inputValue, currTestInput, realInputValue);
|
||||
|
||||
if (realInputValue.length === 0 && currTestInput.length === 0) {
|
||||
// fallback for when no Backspace keydown event (mobile)
|
||||
backspaceToPrevious();
|
||||
|
|
Loading…
Reference in a new issue