Multi chat (#6428)
This commit is contained in:
@@ -41,9 +41,19 @@ export const createNavigationHandler = (navigate: NavigateFunction) => {
|
||||
case 'chat':
|
||||
navigate('/', { state: options });
|
||||
break;
|
||||
case 'pair':
|
||||
navigate('/pair', { state: options });
|
||||
case 'pair': {
|
||||
// Put resumeSessionId in URL search params (not just state) so that:
|
||||
// 1. The sidebar can read it to highlight the active session
|
||||
// 2. Page refresh preserves which session is active
|
||||
// 3. Browser back/forward navigation works correctly
|
||||
const searchParams = new URLSearchParams();
|
||||
if (options?.resumeSessionId) {
|
||||
searchParams.set('resumeSessionId', options.resumeSessionId);
|
||||
}
|
||||
const url = searchParams.toString() ? `/pair?${searchParams.toString()}` : '/pair';
|
||||
navigate(url, { state: options });
|
||||
break;
|
||||
}
|
||||
case 'settings':
|
||||
navigate('/settings', { state: options });
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user