Skip to content

Commit

Permalink
fix(frontend): memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
IgnisDa committed Jul 26, 2023
1 parent 463f5fa commit 13c933e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions apps/frontend/src/lib/layouts/LoggedIn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,14 @@ export default function ({ children }: { children: ReactElement }) {
}, []);

useEffect(() => {
router.events.on("routeChangeComplete", () => {
const handleStart = () => {
close();
});
};

router.events.on("routeChangeComplete", handleStart);
return () => {
router.events.off("routeChangeComplete", handleStart);
};
}, [router]);

return (
Expand Down

0 comments on commit 13c933e

Please sign in to comment.