replaced console with the toast insterd
This commit is contained in:
parent
e558f3abef
commit
b7047b2a19
11 changed files with 7 additions and 31 deletions
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
|
@ -5,5 +5,6 @@
|
|||
"strings": true
|
||||
},
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||||
"css.customData": [".vscode/tailwind.json"]
|
||||
"css.customData": [".vscode/tailwind.json"],
|
||||
"cSpell.words": ["supabase"]
|
||||
}
|
||||
|
|
|
@ -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>
|
||||
|
||||
|
|
|
@ -129,15 +129,6 @@
|
|||
border: 2px solid #444;
|
||||
font-family: "JetBrains Mono", monospace;
|
||||
}
|
||||
h1 {
|
||||
text-align: center;
|
||||
margin: 5px 0px;
|
||||
text-decoration: underline #444;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 50%;
|
||||
transform: translate(-50%, 0);
|
||||
}
|
||||
|
||||
span {
|
||||
font-size: 0.5em;
|
||||
|
|
|
@ -10,8 +10,6 @@ let CorrectWord = generate({
|
|||
minLength: WordLegnth.v,
|
||||
maxLength: WordLegnth.v,
|
||||
});
|
||||
|
||||
console.log("CorrectWord: ", CorrectWord);
|
||||
export let words = $state({ v: [] });
|
||||
export let CurrentWord = $state({ v: [] });
|
||||
export let keys = $state({
|
||||
|
@ -52,7 +50,6 @@ export function newGame() {
|
|||
minLength: WordLegnth.v,
|
||||
maxLength: WordLegnth.v,
|
||||
});
|
||||
console.log("CorrectWord: ", CorrectWord);
|
||||
words.v = [];
|
||||
CurrentWord.v = [];
|
||||
keys.v = [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue