From a5c9433c3bb007582c625f4ab98f62fa6db134ea Mon Sep 17 00:00:00 2001 From: Miodec Date: Thu, 21 Nov 2024 20:55:05 +0100 Subject: fix(custom): crash when trying to start a custom text with a lot of sections containing a lot of words --- frontend/src/ts/test/words-generator.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) { -- cgit v1.2.3