fix(words generator): unnecessairly lowercasing words when funboxes alter word generation

fixes ascii not having capital letters
This commit is contained in:
Miodec 2025-01-02 17:02:49 +01:00
parent 44fbf62282
commit 8e38eae9bc

View file

@ -864,6 +864,10 @@ export async function getNextWord(
throw new WordGenError("Random word contains spaces");
}
const usingFunboxWithGetWord = getActiveFunboxes().some(
(fb) => fb.functions?.getWord
);
if (
Config.mode !== "custom" &&
Config.mode !== "quote" &&
@ -873,7 +877,8 @@ export async function getNextWord(
!Config.language.startsWith("swiss_german") &&
!Config.language.startsWith("code") &&
!Config.language.startsWith("klingon") &&
!isCurrentlyUsingFunboxSection
!isCurrentlyUsingFunboxSection &&
!usingFunboxWithGetWord
) {
randomWord = randomWord.toLowerCase();
}