fix : copy game headers too

This commit is contained in:
GuillaumeSD
2024-04-14 05:45:36 +02:00
parent 1546709452
commit 6b774e085a

View File

@@ -37,11 +37,7 @@ export const useChessActions = (chessAtom: PrimitiveAtom<Chess>) => {
const copyGame = useCallback(() => {
const newGame = new Chess();
if (game.history().length > 0) {
newGame.loadPgn(game.pgn());
} else {
newGame.load(game.fen());
}
newGame.loadPgn(game.pgn());
return newGame;
}, [game]);