replaced console with the toast insterd
This commit is contained in:
parent
e558f3abef
commit
b7047b2a19
11 changed files with 7 additions and 31 deletions
|
@ -27,7 +27,6 @@ export function GenerateQuestionsUsingAI() {
|
|||
})
|
||||
.then((response) => response.json())
|
||||
.then((data) => {
|
||||
console.log(data);
|
||||
questions.v = JSON.parse(data.choices[0].message.content);
|
||||
})
|
||||
.catch((error) => {
|
||||
|
|
|
@ -20,7 +20,7 @@ export async function UpLoadFiles(file) {
|
|||
});
|
||||
|
||||
if (result.error) {
|
||||
console.error("Upload error:", result.error.message);
|
||||
toast.error("Upload error:"+ result.error.message);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -11,9 +11,6 @@
|
|||
gamePin.v = new URLSearchParams(new URL(window.location.href).search).get("gamepin");
|
||||
|
||||
|
||||
|
||||
console.log("Game Pin: " + gamePin.v);
|
||||
|
||||
GetCurrentPlayers(gamePin.v);
|
||||
AutoUpdatePlayersList(gamePin.v);
|
||||
});
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
|
||||
import { gamePin } from "../../logic/HostsData.svelte.js";
|
||||
|
||||
console.log("Game Pin: " + gamePin.v);
|
||||
</script>
|
||||
|
||||
<h1 class="m-[0] text-9xl">HOSTING</h1>
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import { supabase } from "$lib/supabase.js";
|
||||
import toast from "svelte-5-french-toast";
|
||||
import { players } from "./HostsData.svelte.js";
|
||||
|
||||
export async function GetCurrentPlayers(gamePin) {
|
||||
|
@ -7,10 +8,8 @@ export async function GetCurrentPlayers(gamePin) {
|
|||
.select("playername")
|
||||
.eq("gameid", Number(gamePin));
|
||||
|
||||
console.log("Current players data:", JSON.stringify(data));
|
||||
|
||||
if (error) {
|
||||
console.error("Error fetching players:", error);
|
||||
toast.error("Error fetching players: " + error.message);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -64,15 +64,11 @@ export async function WaitForAwnser(questionid, gamePin) {
|
|||
|
||||
TotalTimeLeft.v = CurrentQuestionDetails.v.timeLimit;
|
||||
timeLeft.v = CurrentQuestionDetails.v.timeLimit;
|
||||
console.log("Time left:", timeLeft.v);
|
||||
console.log("Total time left:", TotalTimeLeft.v);
|
||||
|
||||
if (TotalTimeLeft.v != null) {
|
||||
TimeLimitInterval = setInterval(() => {
|
||||
console.log("Time left:", timeLeft.v);
|
||||
if (timeLeft.v > 0) {
|
||||
timeLeft.v--;
|
||||
console.log("Time left after decrement:", timeLeft.v);
|
||||
} else {
|
||||
supabase.removeChannel(WaitingForAwnserConection);
|
||||
currentQuestion.v++;
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import { supabase } from "$lib/supabase.js";
|
||||
import toast from "svelte-5-french-toast";
|
||||
import { players } from "./HostsData.svelte.js";
|
||||
|
||||
export async function GetCurrentPlayers(gamePin) {
|
||||
|
@ -7,10 +8,8 @@ export async function GetCurrentPlayers(gamePin) {
|
|||
.select("playername")
|
||||
.eq("gameid", Number(gamePin));
|
||||
|
||||
console.log("Current players data:", JSON.stringify(data));
|
||||
|
||||
if (error) {
|
||||
console.error("Error fetching players:", error);
|
||||
toast.error("Error fetching players:"+ error);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -18,8 +18,6 @@
|
|||
.eq("gameid", gamePin);
|
||||
|
||||
players = fetchedPlayers.sort((a, b) => b.score - a.score);
|
||||
|
||||
console.log(players);
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue