This commit is contained in:
RezHackXYZ 2025-06-03 16:22:11 +05:30
parent d584e58207
commit 42b9e59ed7

View file

@ -3,6 +3,9 @@ import { QuestionsData, wait } from "./create.svelte.js";
import toast from "svelte-5-french-toast"; import toast from "svelte-5-french-toast";
export async function createGame() { export async function createGame() {
if (wait.v) {
return;
}
wait.v = true; wait.v = true;
const gamePin = Math.floor(Math.random() * 1000000) const gamePin = Math.floor(Math.random() * 1000000)
.toString() .toString()
@ -12,7 +15,7 @@ export async function createGame() {
gameid: gamePin, gameid: gamePin,
questionstext: q.questionText, questionstext: q.questionText,
correctanswer: q.CorrectOption.SingleAnswer, correctanswer: q.CorrectOption.SingleAnswer,
timeLimit: q.TimeLimit, timeLimit: q.timelimit,
media: q.hasMedia ? q.mediaURL : null, media: q.hasMedia ? q.mediaURL : null,
})); }));