Squashed commit of the following:

commit 933ba823d5f991b9ab1f66bd94262c181e9d0267
Author: GuillaumeSD <gsd.lfny@gmail.com>
Date:   Mon Apr 21 20:13:37 2025 +0200

    fix : new chessjs version

commit b9376bcbc718f6eaa9a0fd9caada6b957f73b85a
Author: GuillaumeSD <gsd.lfny@gmail.com>
Date:   Mon Apr 21 19:34:12 2025 +0200

    chore : chessjs bump version
This commit is contained in:
GuillaumeSD
2025-04-21 20:14:13 +02:00
parent 06b447dbed
commit 47e52988f3
8 changed files with 32 additions and 21 deletions

View File

@@ -19,7 +19,6 @@ import {
useMediaQuery,
useTheme,
} from "@mui/material";
import { Chess } from "chess.js";
import { useAtom, useAtomValue, useSetAtom } from "jotai";
import { useRouter } from "next/router";
import { useEffect, useState } from "react";
@@ -35,7 +34,7 @@ export default function GameReview() {
const isMobile = useMediaQuery(theme.breakpoints.down("sm"));
const { reset: resetBoard } = useChessActions(boardAtom);
const { setPgn: setGamePgn } = useChessActions(gameAtom);
const { reset: resetGame } = useChessActions(gameAtom);
const [gameEval, setGameEval] = useAtom(gameEvalAtom);
const game = useAtomValue(gameAtom);
const setBoardOrientation = useSetAtom(boardOrientationAtom);
@@ -48,9 +47,9 @@ export default function GameReview() {
resetBoard();
setGameEval(undefined);
setBoardOrientation(true);
setGamePgn(new Chess().pgn());
resetGame({ noHeaders: true });
}
}, [gameId, setGameEval, setBoardOrientation, resetBoard, setGamePgn]);
}, [gameId, setGameEval, setBoardOrientation, resetBoard, resetGame]);
const isGameLoaded = game.history().length > 0;