AykutSarac 3 years ago
parent
commit
0fc6e8dcd7
1 changed files with 5 additions and 2 deletions
  1. 5 2
      src/hocs/config.tsx

+ 5 - 2
src/hocs/config.tsx

@@ -39,15 +39,18 @@ const WithConfig: ReactComponent = ({ children }) => {
 
   React.useEffect(() => {
     const jsonStored = localStorage.getItem("json");
-    if (jsonStored)
+    if (jsonStored) {
       dispatch({ type: ConfigActionType.SET_JSON, payload: jsonStored });
+    }
 
     const configStored = localStorage.getItem("config");
-    if (configStored)
+    if (configStored) {
       dispatch({
         type: ConfigActionType.SET_CONFIG,
         payload: JSON.parse(configStored),
       });
+    }
+
     setRender(true);
   }, [dispatch]);