Skip to content

Commit 2f3734b

Browse files
committed
refactor(guess-the-word): disable Insane countdown bar within handleGameOver()
1 parent fb1257b commit 2f3734b

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

vanilla/guess-the-word/src/events/handlers/game-over.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { setIsShowingCorrectWord } from "@/state/correct-word";
22
import { setIsAlertInitialized } from "@/state/alert";
3+
import { InsaneDifficulty } from "@/utils/difficulty/insane";
34
import { showCorrectWord } from "@/ui/word";
45
import { $hints, $hintsContent } from "@/ui/hints/elements";
56
import { $randomWord, $reset } from "@/ui/actions";
@@ -20,6 +21,11 @@ export function handleGameOver({ $currentField }) {
2021
setIsShowingCorrectWord(false);
2122
});
2223

24+
if (InsaneDifficulty.isApplied())
25+
import("@/ui/insane-countdown-bar").then(({ InsaneCountdownBar }) =>
26+
InsaneCountdownBar.disable(),
27+
);
28+
2329
$hints.classList.add(CLASSES.HIDDEN);
2430
$hintsContent.classList.add(CLASSES.HIDDEN);
2531

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,6 @@ export function handleLetterInput($currentField) {
3333
if (implementsMaxResets() && gameResets === maxResets) {
3434
handleLetterMistake({ $currentLetter, enteredLetter, tries });
3535
handleGameOver({ $currentField });
36-
// TODO: move to handleGameOver()
37-
if (InsaneDifficulty.isApplied())
38-
import("@/ui/insane-countdown-bar").then(({ InsaneCountdownBar }) =>
39-
InsaneCountdownBar.disable(),
40-
);
4136
return;
4237
}
4338

0 commit comments

Comments
 (0)