From 6b774e085ae21a00c48bc4a91db2d27c269e0784 Mon Sep 17 00:00:00 2001 From: GuillaumeSD Date: Sun, 14 Apr 2024 05:45:36 +0200 Subject: [PATCH] fix : copy game headers too --- src/hooks/useChessActions.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/hooks/useChessActions.ts b/src/hooks/useChessActions.ts index fc21ae6..763a517 100644 --- a/src/hooks/useChessActions.ts +++ b/src/hooks/useChessActions.ts @@ -37,11 +37,7 @@ export const useChessActions = (chessAtom: PrimitiveAtom) => { 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]);