Skip to content

Commit 552084a

Browse files
committed
Make a hacky fix
1 parent 403866c commit 552084a

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

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)