Browse Source

clear storage on clear fired

Aykut Saraç 3 years ago
parent
commit
9802e88838
1 changed files with 8 additions and 1 deletions
  1. 8 1
      src/components/Sidebar/index.tsx

+ 8 - 1
src/components/Sidebar/index.tsx

@@ -142,7 +142,14 @@ export const Sidebar: React.FC<{
             </a>
           </Link>
         </StyledElement>
-        <StyledElement as="a" onClick={() => setJson("[]")} title="Clear JSON">
+        <StyledElement
+          as="a"
+          onClick={() => {
+            setJson("[]");
+            localStorage.removeItem("json");
+          }}
+          title="Clear JSON"
+        >
           <AiOutlineClear />
         </StyledElement>
         <StyledElement