fix : lint warnings & errors

This commit is contained in:
GuillaumeSD
2024-02-25 02:19:13 +01:00
parent 8d15b7e1a2
commit 7412f708d0
6 changed files with 18 additions and 21 deletions

View File

@@ -17,13 +17,15 @@ export default function EvaluationBar({ height }: Props) {
const boardOrientation = useAtomValue(boardOrientationAtom);
const currentMove = useAtomValue(currentMoveAtom);
const isWhiteToPlay = board.turn() === "w";
useEffect(() => {
const bestLine = currentMove?.eval?.lines[0];
if (!bestLine) return;
const evalBar = getEvaluationBarValue(bestLine, board.turn() === "w");
const evalBar = getEvaluationBarValue(bestLine, isWhiteToPlay);
setEvalBar(evalBar);
}, [currentMove, board.turn()]);
}, [currentMove, isWhiteToPlay]);
return (
<Grid