AykutSarac 3 年之前
父節點
當前提交
0fc6e8dcd7
共有 1 個文件被更改,包括 5 次插入2 次删除
  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]);