fix(custom): crash when trying to start a custom text with a lot of sections containing a lot of words

This commit is contained in:
Miodec 2024-11-21 20:55:05 +01:00
parent a3916cb0cb
commit a5c9433c3b

View file

@ -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) {