Skip to content

Commit

Permalink
[FIX] storage of current color
Browse files Browse the repository at this point in the history
  • Loading branch information
Coding0tter authored Sep 2, 2023
1 parent 5cfed92 commit c68532b
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,17 @@ const App: Component = () => {
if (dontShowTutorial) {
setShowTutorial(false);
}
if (!savedColor) {
localStorage.setItem("color", color());
} else if (savedColor !== color()) {

if (savedColor !== color()) {
//clear storage
localStorage.removeItem("guesses");
localStorage.removeItem("currentRow");
localStorage.removeItem("matches");
localStorage.removeItem("won");
localStorage.removeItem("lost");
}
if (!savedColor) {
localStorage.setItem("color", color());
}

localStorage.setItem("color", color());
}, []);

return (
Expand Down

0 comments on commit c68532b

Please sign in to comment.