From c68532b04934183780937d59d70b5ff981495489 Mon Sep 17 00:00:00 2001 From: Otterman <44608230+K1ngcuber@users.noreply.github.com> Date: Sun, 3 Sep 2023 00:05:50 +0200 Subject: [PATCH] [FIX] storage of current color --- src/App.tsx | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index cddfb40..a4bc815 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -34,9 +34,8 @@ 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"); @@ -44,9 +43,8 @@ const App: Component = () => { localStorage.removeItem("won"); localStorage.removeItem("lost"); } - if (!savedColor) { - localStorage.setItem("color", color()); - } + + localStorage.setItem("color", color()); }, []); return (