fix no confeti if win in wordle!

This commit is contained in:
RezHackXYZ 2025-06-01 10:19:52 +05:30
parent aadcab9fd7
commit 41941f98e8
2 changed files with 11 additions and 2 deletions

View file

@ -2,6 +2,8 @@ import wordExists from "word-exists";
import { generate } from "random-words";
import toast from "svelte-5-french-toast";
export let jsConfetti = $state({ v: null });
export let WordLegnth = $state({ v: 5 });
let CorrectWord = generate({
@ -88,6 +90,8 @@ export function newGame() {
function GameWin() {
toast.success("You win!");
jsConfetti.v.addConfetti();
data.value[WordLegnth.v].push(words.v.length);
localStorage.setItem("WordleGamesData", JSON.stringify(data.value));
newGame();
@ -201,4 +205,4 @@ export let data = $state({
9: [],
10: [],
},
});
});