diff --git a/components/level/gameLayout.tsx b/components/level/gameLayout.tsx
index 51c9e711d..5af8d5d8a 100644
--- a/components/level/gameLayout.tsx
+++ b/components/level/gameLayout.tsx
@@ -45,10 +45,6 @@ export default function GameLayout({ controls, disableCheckpoints, gameState, hi
setShowHeader(!fullScreen);
}, [fullScreen, setShowHeader]);
- useEffect(() => {
- setPreventKeyDownEvent(isCheckpointOpen || isLevelInfoOpen);
- }, [isCheckpointOpen, isLevelInfoOpen, setPreventKeyDownEvent]);
-
return (
setIsLevelInfoOpen(false)}
+ closeModal={() => {
+ setIsLevelInfoOpen(false);
+ setPreventKeyDownEvent(false);
+ }}
isOpen={isLevelInfoOpen}
level={level}
/>
@@ -104,7 +106,10 @@ export default function GameLayout({ controls, disableCheckpoints, gameState, hi
data-tooltip-content='Checkpoints'
data-tooltip-id='checkpoint-tooltip'
id='checkpointBtn'
- onClick={() => setIsCheckpointOpen(!isCheckpointOpen)}
+ onClick={() => {
+ setIsCheckpointOpen(!isCheckpointOpen);
+ setPreventKeyDownEvent(true);
+ }}
>