Skip to content

Commit 0e8274f

Browse files
committed
refactor: checking if all words were generated before stopping the test
1 parent fb72134 commit 0e8274f

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,8 @@ function handleChar(
702702
//do not stop if not all characters have been parsed by handleChar yet
703703
const currentWord = TestWords.words.getCurrent();
704704
const lastWordIndex = TestWords.words.currentIndex;
705-
const isLastWord = lastWordIndex === TestWords.words.length - 1;
705+
const lastWord = lastWordIndex === TestWords.words.length - 1;
706+
const allWordGenerated = TestLogic.areAllTestWordsGenerated();
706707
const wordIsTheSame = currentWord === TestInput.input.current;
707708
const shouldQuickEnd =
708709
Config.quickEnd &&
@@ -712,7 +713,8 @@ function handleChar(
712713
const isChinese = Config.language.startsWith("chinese");
713714

714715
if (
715-
isLastWord &&
716+
lastWord &&
717+
allWordGenerated &&
716718
(wordIsTheSame || shouldQuickEnd) &&
717719
(!isChinese ||
718720
(realInputValue !== undefined &&

0 commit comments

Comments
 (0)