We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ca74c9b commit 80086dbCopy full SHA for 80086db
1 file changed
src/hooks/useChessGame.ts
@@ -47,11 +47,11 @@ export const useChessGame = () => {
47
};
48
49
const getLastMove = () => {
50
- const moves = chessGameRef.current.moves({ verbose: true });
51
- if (moves.length === 0) {
+ const history = chessGameRef.current.history({ verbose: true });
+ if (history.length === 0) {
52
return null;
53
}
54
- const lastMove = moves[moves.length - 1];
+ const lastMove = history[history.length - 1];
55
return {
56
from: lastMove.from,
57
to: lastMove.to,
0 commit comments