This commit is contained in:
AykutSarac 2022-04-28 16:49:00 +03:00
parent eb103c8e9f
commit 0fc6e8dcd7

View File

@ -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]);