Skip to content

Commit e52df88

Browse files
committed
chore: rename function, better log
1 parent a1e0da8 commit e52df88

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

frontend/src/ts/test/words-generator.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ export function getWordOrder(): FunboxWordOrder {
398398
}
399399
}
400400

401-
export function getWordsLimit(): number {
401+
export function getLimit(): number {
402402
if (Config.mode === "zen") {
403403
return 0;
404404
}
@@ -624,8 +624,13 @@ export async function generateWords(
624624
wordList = [];
625625
}
626626

627-
const limit = getWordsLimit();
628-
console.debug("Words limit", limit);
627+
const customAndUsingPipeDelimiter =
628+
Config.mode === "custom" && CustomText.getPipeDelimiter();
629+
630+
const limit = getLimit();
631+
console.debug(
632+
`${customAndUsingPipeDelimiter ? "Section" : "Word"} limit ${limit}`
633+
);
629634

630635
if (wordOrder === "reverse") {
631636
wordList = wordList.reverse();
@@ -656,7 +661,7 @@ export async function generateWords(
656661
ret.words.push(nextWord.word);
657662
ret.sectionIndexes.push(nextWord.sectionIndex);
658663

659-
if (Config.mode === "custom" && CustomText.getPipeDelimiter()) {
664+
if (customAndUsingPipeDelimiter) {
660665
//generate a given number of sections, make sure to not cut a section off
661666
const sectionFinishedAndOverLimit =
662667
currentSection.length === 0 && sectionIndex >= limit;

0 commit comments

Comments
 (0)