From 3e3fad5c838770fafec26ea9ff5a528399b23bfb Mon Sep 17 00:00:00 2001 From: RezHackXYZ Date: Sun, 1 Jun 2025 13:14:14 +0530 Subject: [PATCH] fixed bug where the buttons dont go back to orginal sate if it failed and made the var into $satate --- .../create/components/Questions/question.svelte | 2 +- src/routes/kahootclone/create/logic/InsertGameInDB.js | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/routes/kahootclone/create/components/Questions/question.svelte b/src/routes/kahootclone/create/components/Questions/question.svelte index 4a976a6..e739168 100644 --- a/src/routes/kahootclone/create/components/Questions/question.svelte +++ b/src/routes/kahootclone/create/components/Questions/question.svelte @@ -8,7 +8,7 @@ let props = $props(); let index = props.index; - let files; + let files = $state();
diff --git a/src/routes/kahootclone/create/logic/InsertGameInDB.js b/src/routes/kahootclone/create/logic/InsertGameInDB.js index ce24e40..8d4e525 100644 --- a/src/routes/kahootclone/create/logic/InsertGameInDB.js +++ b/src/routes/kahootclone/create/logic/InsertGameInDB.js @@ -19,8 +19,8 @@ export async function createGame(questions, gamePin) { }); if (gameError) { - return; Wait.v = false; + return; } // Prepare questions and answers for batch insertion @@ -47,8 +47,9 @@ export async function createGame(questions, gamePin) { ); if (questionsError) { - return; Wait.v = false; + + return; } const answersData = []; @@ -71,8 +72,8 @@ export async function createGame(questions, gamePin) { }); if (answersError) { + Wait.v = false return; - Wait.v = false; } window.location.href = `/kahootclone/host?gamepin=${gamePin}`;