mirror of
https://github.com/TheRealOwenRees/chess-scribe-website.git
synced 2026-07-23 01:46:57 +00:00
remove try/catch in downloadString
This commit is contained in:
@@ -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 () => {
|
||||
|
||||
Reference in New Issue
Block a user