Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import styles from './BoardControls.module.css';

export default function BoardControls() {
const game = useGameStore((state) => state.game);
const isTerminal = useGameStore((state) => state.options.replay.steps.at(state.options.step)?.isTerminal ?? false);
const { toggle, soundEnabled } = usePreferences();
const transition = useTransition({ duration: 0.3 });

Expand All @@ -19,7 +20,7 @@ export default function BoardControls() {
// regular `inert` prop once the project upgrades to React 19+.
const inertRef = (el: HTMLElement | null) => {
if (!el) return;
if (game.isGameOver()) el.setAttribute('inert', '');
if (isTerminal) el.setAttribute('inert', '');
else el.removeAttribute('inert');
};

Expand Down