diff --git a/frontend/src/ts/test/test-logic.ts b/frontend/src/ts/test/test-logic.ts index 158696402..c855e11cf 100644 --- a/frontend/src/ts/test/test-logic.ts +++ b/frontend/src/ts/test/test-logic.ts @@ -807,10 +807,7 @@ async function getNextWord( let regenarationCount = 0; //infinite loop emergency stop button while ( regenarationCount < 100 && - ((Config.mode !== "custom" && - /[A-Z]/.test(randomWord) && - !Config.punctuation) || - previousWord == randomWord || + (previousWord == randomWord || previousWord2 == randomWord || (Config.mode !== "custom" && !Config.punctuation && @@ -827,6 +824,14 @@ async function getNextWord( } } + if ( + Config.mode !== "custom" && + /[A-Z]/.test(randomWord) && + !Config.punctuation + ) { + randomWord = randomWord.toLowerCase(); + } + if (randomWord === undefined) { randomWord = wordset.randomWord(); }