mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-09-07 23:26:59 +08:00
chore: rename function, better log
This commit is contained in:
parent
a1e0da8ed6
commit
e52df88369
1 changed files with 9 additions and 4 deletions
|
@ -398,7 +398,7 @@ export function getWordOrder(): FunboxWordOrder {
|
|||
}
|
||||
}
|
||||
|
||||
export function getWordsLimit(): number {
|
||||
export function getLimit(): number {
|
||||
if (Config.mode === "zen") {
|
||||
return 0;
|
||||
}
|
||||
|
@ -624,8 +624,13 @@ export async function generateWords(
|
|||
wordList = [];
|
||||
}
|
||||
|
||||
const limit = getWordsLimit();
|
||||
console.debug("Words limit", limit);
|
||||
const customAndUsingPipeDelimiter =
|
||||
Config.mode === "custom" && CustomText.getPipeDelimiter();
|
||||
|
||||
const limit = getLimit();
|
||||
console.debug(
|
||||
`${customAndUsingPipeDelimiter ? "Section" : "Word"} limit ${limit}`
|
||||
);
|
||||
|
||||
if (wordOrder === "reverse") {
|
||||
wordList = wordList.reverse();
|
||||
|
@ -656,7 +661,7 @@ export async function generateWords(
|
|||
ret.words.push(nextWord.word);
|
||||
ret.sectionIndexes.push(nextWord.sectionIndex);
|
||||
|
||||
if (Config.mode === "custom" && CustomText.getPipeDelimiter()) {
|
||||
if (customAndUsingPipeDelimiter) {
|
||||
//generate a given number of sections, make sure to not cut a section off
|
||||
const sectionFinishedAndOverLimit =
|
||||
currentSection.length === 0 && sectionIndex >= limit;
|
||||
|
|
Loading…
Add table
Reference in a new issue