From 8732e59024c28da55f42cbc223599a024454ffd0 Mon Sep 17 00:00:00 2001 From: AykutSarac Date: Wed, 15 Jun 2022 09:24:27 +0300 Subject: [PATCH] remove localstorage actions for json --- src/containers/ClearModal/index.tsx | 1 - src/hocs/config.tsx | 6 +----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/containers/ClearModal/index.tsx b/src/containers/ClearModal/index.tsx index b268bff..8b41f70 100644 --- a/src/containers/ClearModal/index.tsx +++ b/src/containers/ClearModal/index.tsx @@ -10,7 +10,6 @@ export const ClearModal: React.FC = ({ visible, setVisible }) => { const handleClear = () => { dispatch({ type: ConfigActionType.SET_JSON, payload: "{}" }); - localStorage.removeItem("json"); toast.success(`Cleared JSON and removed from memory.`); setVisible(false); }; diff --git a/src/hocs/config.tsx b/src/hocs/config.tsx index 581dae9..0879f57 100644 --- a/src/hocs/config.tsx +++ b/src/hocs/config.tsx @@ -43,12 +43,8 @@ const WithConfig: ReactComponent = ({ children }) => { }; React.useEffect(() => { - const jsonStored = localStorage.getItem("json"); - if (jsonStored) { - dispatch({ type: ConfigActionType.SET_JSON, payload: jsonStored }); - } - const configStored = localStorage.getItem("config"); + if (configStored) { dispatch({ type: ConfigActionType.SET_CONFIG,