Explorar el Código

clear storage on clear fired

Aykut Saraç hace 3 años
padre
commit
9802e88838
Se han modificado 1 ficheros con 8 adiciones y 1 borrados
  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