fixed the local storage thing in wordle!
This commit is contained in:
parent
de7e3da139
commit
c00644d14e
3 changed files with 20 additions and 38 deletions
|
@ -89,7 +89,7 @@ function GameWin() {
|
|||
toast.success("You win!");
|
||||
|
||||
data.value[WordLegnth.v].push(words.v.length);
|
||||
//localStorage.setItem("WordleGamesData", JSON.stringify(data.value));
|
||||
localStorage.setItem("WordleGamesData", JSON.stringify(data.value));
|
||||
newGame();
|
||||
}
|
||||
|
||||
|
@ -201,22 +201,4 @@ export let data = $state({
|
|||
9: [],
|
||||
10: [],
|
||||
},
|
||||
});
|
||||
|
||||
// let WordleGamesData = localStorage.getItem("WordleGamesData") || "";
|
||||
let WordleGamesData = "";
|
||||
|
||||
if (WordleGamesData != "") {
|
||||
data.value = JSON.parse(WordleGamesData);
|
||||
} else {
|
||||
data.value = {
|
||||
3: [],
|
||||
4: [],
|
||||
5: [],
|
||||
6: [],
|
||||
7: [],
|
||||
8: [],
|
||||
9: [],
|
||||
10: [],
|
||||
};
|
||||
}
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue