From 22f6ff03323a0abb19ea9264265a07be0e272c0a Mon Sep 17 00:00:00 2001 From: devanshu052000 Date: Mon, 24 Mar 2025 23:39:53 +0530 Subject: [PATCH] Fix page not switching in public apps. --- frontend/src/Routes/AppsRoute.jsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/frontend/src/Routes/AppsRoute.jsx b/frontend/src/Routes/AppsRoute.jsx index e31d692d98..b84a2b04ff 100644 --- a/frontend/src/Routes/AppsRoute.jsx +++ b/frontend/src/Routes/AppsRoute.jsx @@ -32,6 +32,8 @@ export const AppsRoute = ({ children, componentType }) => { onValidSession(); } + // handle back and forward navigation + window.addEventListener('popstate', handleBrowserNavigation); return () => window.removeEventListener('popstate', handleBrowserNavigation); // eslint-disable-next-line react-hooks/exhaustive-deps }, [isValidSession]); @@ -71,9 +73,6 @@ export const AppsRoute = ({ children, componentType }) => { setExtraProps(restDetails); setLoading(false); } - - // handle back and forward navigation - window.addEventListener('popstate', handleBrowserNavigation); }; const handleBrowserNavigation = (e) => {