mirror of
https://github.com/LukeHagar/sveltekit-adapters.git
synced 2025-12-07 12:47:49 +00:00
Update examples/electron/src/routes/sverdle/+page.server.ts
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
@@ -30,7 +30,14 @@ export const load = (({ cookies }) => {
|
|||||||
|
|
||||||
return gameState
|
return gameState
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log("Error getting cookie", e);
|
console.error("Error loading game state:", e);
|
||||||
|
// Return a new game state as fallback
|
||||||
|
const newGame = new Game();
|
||||||
|
return {
|
||||||
|
guesses: newGame.guesses,
|
||||||
|
answers: newGame.answers,
|
||||||
|
answer: null
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}) satisfies PageServerLoad;
|
}) satisfies PageServerLoad;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user