Skip to content

Commit edf71da

Browse files
committed
fix: custom mode limit breaking show all lines in some cases
monkeytypegame#6072
1 parent a5c9433 commit edf71da

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

frontend/src/ts/test/test-ui.ts

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -497,12 +497,18 @@ function updateWordsHeight(force = false): void {
497497
const wordsHeight = $(
498498
document.querySelector("#words") as Element
499499
).outerHeight(true) as number;
500-
if (
501-
Config.showAllLines &&
502-
Config.mode !== "time" &&
503-
CustomText.getLimitMode() !== "time" &&
504-
CustomText.getLimitValue() !== 0
505-
) {
500+
501+
const shouldLimitToThreeLines =
502+
Config.mode === "time" ||
503+
(Config.mode === "custom" && CustomText.getLimitMode() === "time") ||
504+
(Config.mode === "custom" &&
505+
CustomText.getLimitMode() === "word" &&
506+
CustomText.getLimitValue() === 0) ||
507+
(Config.mode === "custom" &&
508+
CustomText.getLimitMode() === "section" &&
509+
CustomText.getLimitValue() === 0);
510+
511+
if (Config.showAllLines && !shouldLimitToThreeLines) {
506512
// overflow-x should not be visible in tape mode, but since showAllLines can't
507513
// be enabled simultaneously with tape mode we don't need to check it's off
508514
$("#words")

0 commit comments

Comments
 (0)