From 42aa055eb4c29ece5f6d67f37c830a3867419092 Mon Sep 17 00:00:00 2001 From: Miodec Date: Wed, 24 Apr 2024 14:57:41 +0200 Subject: [PATCH] fix(word generation): plus n funboxes causing custom tests to go over the limit --- frontend/src/ts/test/words-generator.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/frontend/src/ts/test/words-generator.ts b/frontend/src/ts/test/words-generator.ts index cd23d254b..33f80bbf7 100644 --- a/frontend/src/ts/test/words-generator.ts +++ b/frontend/src/ts/test/words-generator.ts @@ -403,6 +403,8 @@ export function getWordsLimit(): number { if (Config.mode === "words" && Config.words === 0) { limit = 100; } + + //custom if (Config.mode === "custom") { if ( CustomText.getLimitValue() === 0 || @@ -426,6 +428,14 @@ export function getWordsLimit(): number { limit = Config.words; } + if ( + Config.mode === "custom" && + CustomText.getLimitMode() === "word" && + CustomText.getLimitValue() < limit + ) { + limit = CustomText.getLimitValue(); + } + return limit; }