From 8e38eae9bc6f08348d4c2979ba63527ecb12e193 Mon Sep 17 00:00:00 2001 From: Miodec Date: Thu, 2 Jan 2025 17:02:49 +0100 Subject: [PATCH] fix(words generator): unnecessairly lowercasing words when funboxes alter word generation fixes ascii not having capital letters --- frontend/src/ts/test/words-generator.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/frontend/src/ts/test/words-generator.ts b/frontend/src/ts/test/words-generator.ts index d2461d9ac495..44bd3beb6a0c 100644 --- a/frontend/src/ts/test/words-generator.ts +++ b/frontend/src/ts/test/words-generator.ts @@ -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(); }