diff --git a/my-app/src/index.jsx b/my-app/src/index.jsx index af40b85..e3a866c 100644 --- a/my-app/src/index.jsx +++ b/my-app/src/index.jsx @@ -44,4 +44,4 @@ createRoot(document.getElementById("root")).render( ); // give user access for debugging purpose -window.myModel = reactiveModel; +//window.myModel = reactiveModel; diff --git a/my-app/src/pages/App.jsx b/my-app/src/pages/App.jsx index 6296f2e..bd75350 100644 --- a/my-app/src/pages/App.jsx +++ b/my-app/src/pages/App.jsx @@ -15,17 +15,17 @@ import { slide as Menu } from "react-burger-menu"; function App({ model }) { const [sidebarIsOpen, setSidebarIsOpen] = useState(model.sidebarIsOpen); - // useEffect(() => { - // const clearStorageOnUnload = () => { - // localStorage.clear(); - // }; + useEffect(() => { + const clearStorageOnUnload = () => { + localStorage.removeItem("filterOptions"); + }; - // window.addEventListener("unload", clearStorageOnUnload); + // window.addEventListener("unload", clearStorageOnUnload); - // return () => { - // window.removeEventListener("unload", clearStorageOnUnload); - // }; - // }, []); + return () => { + window.removeEventListener("unload", clearStorageOnUnload); + }; + }, []); useState(() => { if (window.innerWidth < 700) {