Skip to content

Commit 390a56f

Browse files
authored
Hacky Expo Fix (#156)
* Making the search persistent again... * Removing the debug model access * Make a hacky fix
1 parent 7e7fd55 commit 390a56f

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

my-app/src/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,4 @@ createRoot(document.getElementById("root")).render(
4444
<RouterProvider router={makeRouter(reactiveModel)} />
4545
);
4646
// give user access for debugging purpose
47-
window.myModel = reactiveModel;
47+
//window.myModel = reactiveModel;

my-app/src/pages/App.jsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,17 @@ import { slide as Menu } from "react-burger-menu";
1515
function App({ model }) {
1616
const [sidebarIsOpen, setSidebarIsOpen] = useState(model.sidebarIsOpen);
1717

18-
// useEffect(() => {
19-
// const clearStorageOnUnload = () => {
20-
// localStorage.clear();
21-
// };
18+
useEffect(() => {
19+
const clearStorageOnUnload = () => {
20+
localStorage.removeItem("filterOptions");
21+
};
2222

23-
// window.addEventListener("unload", clearStorageOnUnload);
23+
// window.addEventListener("unload", clearStorageOnUnload);
2424

25-
// return () => {
26-
// window.removeEventListener("unload", clearStorageOnUnload);
27-
// };
28-
// }, []);
25+
return () => {
26+
window.removeEventListener("unload", clearStorageOnUnload);
27+
};
28+
}, []);
2929

3030
useState(() => {
3131
if (window.innerWidth < 700) {

0 commit comments

Comments
 (0)