Skip to content

Commit 9953d26

Browse files
committed
fix(guess-the-word): avoid rendering of hints section on void difficulty
1 parent 5cdd12d commit 9953d26

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

vanilla/guess-the-word/src/events/handlers/letter-input.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { currentWord } from "@/state/current-word";
2+
import { difficulty } from "@/state/difficulty";
23
import { increaseTries, maxTries, tries } from "@/state/tries";
34
import { maxResets, gameResets, implementsMaxResets } from "@/state/resets";
45
import { handleLetterMistake } from "./letter-mistake";
@@ -13,8 +14,9 @@ import { addHint } from "@/ui/hints/add";
1314
import { $hints } from "@/ui/hints/elements";
1415
import { isValidTypingLetter } from "@/ui/typing/validation";
1516
import { $reset } from "@/ui/actions";
16-
import { CLASSES } from "@/consts/css-classes";
17+
import { DIFFICULTY } from "@/consts/difficulty";
1718
import { TRIES } from "@/consts/tries";
19+
import { CLASSES } from "@/consts/css-classes";
1820

1921
/** @param {HTMLInputElement} $currentField */
2022
export function handleLetterInput($currentField) {
@@ -51,7 +53,11 @@ export function handleLetterInput($currentField) {
5153
$currentLetter.dataset.state = "correct";
5254
}
5355

54-
if (tries <= TRIES.FIRST && gameResets <= maxResets)
56+
if (
57+
difficulty !== DIFFICULTY.VOID &&
58+
tries <= TRIES.FIRST &&
59+
gameResets <= maxResets
60+
)
5561
$hints.classList.remove(CLASSES.HIDDEN);
5662

5763
const $nextLetter = $currentLetter.nextElementSibling;

0 commit comments

Comments
 (0)