feat: enhance navigation handling by updating navigation key and improving page state management

This commit is contained in:
Arunavo Ray
2025-05-24 12:52:02 +05:30
parent 70b3e412ad
commit 546db472e5
3 changed files with 13 additions and 2 deletions

View File

@@ -74,6 +74,8 @@ function AppWithProviders({ page: initialPage }: AppProps) {
const pageName = pageMap[path] || 'dashboard';
setCurrentPage(pageName);
// Also increment navigation key for browser navigation to trigger loading states
setNavigationKey(prev => prev + 1);
};
window.addEventListener('popstate', handlePopState);