diff options
author | Miodec <[email protected]> | 2024-11-21 20:55:05 +0100 |
---|---|---|
committer | Miodec <[email protected]> | 2024-11-25 12:53:20 +0100 |
commit | a5c9433c3bb007582c625f4ab98f62fa6db134ea (patch) | |
tree | e55b3853a849c2cd39a0c652657cfc88c19f3724 | |
parent | a3916cb0cb1870eafd57509ea3e102af1a682ffe (diff) | |
download | monkeytype-a5c9433c3bb007582c625f4ab98f62fa6db134ea.tar.gz monkeytype-a5c9433c3bb007582c625f4ab98f62fa6db134ea.zip |
fix(custom): crash when trying to start a custom text with a lot of sections containing a lot of words
-rw-r--r-- | frontend/src/ts/test/words-generator.ts | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/frontend/src/ts/test/words-generator.ts b/frontend/src/ts/test/words-generator.ts index 00e31ebe2..a99fa329f 100644 --- a/frontend/src/ts/test/words-generator.ts +++ b/frontend/src/ts/test/words-generator.ts @@ -663,7 +663,7 @@ export async function generateWords( const sectionFinishedAndOverLimit = currentSection.length === 0 && sectionIndex >= CustomText.getLimitValue(); - if (sectionFinishedAndOverLimit) { + if (sectionFinishedAndOverLimit || ret.words.length >= 100) { stop = true; } } else if (ret.words.length >= limit) { |