mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2026-01-05 06:54:36 +08:00
converting to lowercase if punctuation is disabled instead of regenerating
This commit is contained in:
parent
e9c6534c39
commit
d1fbc21c1e
1 changed files with 9 additions and 4 deletions
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue