Skip to content

Commit 80086db

Browse files
committed
fix: highlight last move
1 parent ca74c9b commit 80086db

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/hooks/useChessGame.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ export const useChessGame = () => {
4747
};
4848

4949
const getLastMove = () => {
50-
const moves = chessGameRef.current.moves({ verbose: true });
51-
if (moves.length === 0) {
50+
const history = chessGameRef.current.history({ verbose: true });
51+
if (history.length === 0) {
5252
return null;
5353
}
54-
const lastMove = moves[moves.length - 1];
54+
const lastMove = history[history.length - 1];
5555
return {
5656
from: lastMove.from,
5757
to: lastMove.to,

0 commit comments

Comments
 (0)