fix issue where app redirects to home after initialization but user has already started a chat (#4260)

This commit is contained in:
Zane
2025-08-21 14:59:57 -07:00
committed by GitHub
parent 72f4ebc640
commit 953e94a34d
2 changed files with 14 additions and 2 deletions
+12 -2
View File
@@ -95,8 +95,18 @@ export const initializeApp = async ({
}
}
}
window.location.hash = '#/';
window.history.replaceState({}, '', '#/');
// Only redirect to home if we're still on the initial empty hash or root
// This prevents redirecting users who have already navigated elsewhere during initialization
const currentHash = window.location.hash;
const currentPathname = window.location.pathname;
const isOnRootRoute =
currentPathname === '/' && (!currentHash || currentHash === '#' || currentHash === '#/');
if (isOnRootRoute) {
window.location.hash = '#/';
window.history.replaceState({}, '', '#/');
}
};
const initializeForSessionResume = async ({