Skip to content

Commit 0891df5

Browse files
committed
chore: use game.gameover to set inert (#855)
1 parent 98b64d0 commit 0891df5

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

  • kaggle_environments/envs/open_spiel_env/games/go/visualizer/v2/src/components

kaggle_environments/envs/open_spiel_env/games/go/visualizer/v2/src/components/Annotation.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,13 +209,12 @@ export default function Annotation() {
209209

210210
const notation = matches.toSorted((a, b) => a.priority - b.priority)[0];
211211

212-
const gameOver = options.replay.steps.at(options.step)?.winner;
213212
// React 18 doesn't support the `inert` HTML attribute as a prop, so we
214213
// set it imperatively via a ref callback. This can be replaced with a
215214
// regular `inert` prop once the project upgrades to React 19+.
216215
const inertRef = (el: HTMLElement | null) => {
217216
if (!el) return;
218-
if (gameOver) el.setAttribute('inert', '');
217+
if (game.gameOver) el.setAttribute('inert', '');
219218
else el.removeAttribute('inert');
220219
};
221220

0 commit comments

Comments
 (0)