remove try/catch in downloadString

This commit is contained in:
2026-06-03 09:53:48 +02:00
parent 2d56700dd8
commit 6a9a51c1ed
3 changed files with 17 additions and 15 deletions
+11 -2
View File
@@ -29,8 +29,17 @@ export const useChessGame = () => {
}, []);
const handleSavePgn = () => {
const pgnString = buildPgnString(gameState);
downloadString(pgnString, "game.pgn");
try {
const pgnString = buildPgnString(gameState);
downloadString(pgnString, "game.pgn");
} catch (error) {
// TODO logger
console.error(error);
toast.error("An error occurred while saving the PGN. Please try again.", {
toastId: "pgn-download-error",
});
}
};
const handleSavePdf = async () => {