Skip to content

Commit

Permalink
fix: custom mode limit breaking show all lines in some cases
Browse files Browse the repository at this point in the history
  • Loading branch information
Miodec committed Nov 25, 2024
1 parent a5c9433 commit edf71da
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions frontend/src/ts/test/test-ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -497,12 +497,18 @@ function updateWordsHeight(force = false): void {
const wordsHeight = $(
document.querySelector("#words") as Element
).outerHeight(true) as number;
if (
Config.showAllLines &&
Config.mode !== "time" &&
CustomText.getLimitMode() !== "time" &&
CustomText.getLimitValue() !== 0
) {

const shouldLimitToThreeLines =
Config.mode === "time" ||
(Config.mode === "custom" && CustomText.getLimitMode() === "time") ||
(Config.mode === "custom" &&
CustomText.getLimitMode() === "word" &&
CustomText.getLimitValue() === 0) ||
(Config.mode === "custom" &&
CustomText.getLimitMode() === "section" &&
CustomText.getLimitValue() === 0);

if (Config.showAllLines && !shouldLimitToThreeLines) {
// overflow-x should not be visible in tape mode, but since showAllLines can't
// be enabled simultaneously with tape mode we don't need to check it's off
$("#words")
Expand Down

0 comments on commit edf71da

Please sign in to comment.