Skip to content

Commit 87b4114

Browse files
committed
checking if there is still input to be pushed
moved the check into one place fixes monkeytypegame#3981
1 parent 8f26f5f commit 87b4114

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

frontend/src/ts/controllers/input-controller.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -580,8 +580,6 @@ function handleChar(
580580
}
581581

582582
if (!thisCharCorrect && Config.difficulty == "master") {
583-
TestInput.input.pushHistory();
584-
TestInput.corrected.pushHistory();
585583
TestLogic.fail("difficulty");
586584
return;
587585
}
@@ -599,8 +597,6 @@ function handleChar(
599597
Config.stopOnError == "off")) &&
600598
lastIndex === TestWords.words.length - 1
601599
) {
602-
TestInput.input.pushHistory();
603-
TestInput.corrected.pushHistory();
604600
TestLogic.finish();
605601
return;
606602
}

frontend/src/ts/test/test-logic.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1465,7 +1465,7 @@ function buildCompletedEvent(difficultyFailed: boolean): CompletedEvent {
14651465

14661466
export async function finish(difficultyFailed = false): Promise<void> {
14671467
if (!TestActive.get()) return;
1468-
if (Config.mode == "zen" && TestInput.input.current.length != 0) {
1468+
if (TestInput.input.current.length != 0) {
14691469
TestInput.input.pushHistory();
14701470
TestInput.corrected.pushHistory();
14711471
Replay.replayGetWordsList(TestInput.input.history);

0 commit comments

Comments
 (0)