fix: cancelling "Discard unsaved changes?" no longer leaves the main chat blank (#34300)

This commit is contained in:
G30 authored and GitHub committed 2026-11-13 17:38:08 +09:00
1 parent 8590455786
commit dceadf9db0
1 file changed
+5 -3
+5 -3
View File
@@ -16,7 +16,7 @@
const i18n: Writable<i18nType> = getContext('i18n');
const appLayout = getContext<AppLayoutContext | undefined>('appLayout');
import { goto, beforeNavigate, afterNavigate } from '$app/navigation';
import { goto, beforeNavigate, afterNavigate, onNavigate } from '$app/navigation';
import { page } from '$app/stores';
import { get, writable, type Unsubscriber, type Writable } from 'svelte/store';
@@ -2740,11 +2740,13 @@
}
stopAudio();
});
beforeNavigate(({ from, to }) => {
if (!embedded && to && from?.url.pathname !== to.url.pathname) loading = true;
beforeNavigate(() => {
bridge?.end();
pendingUrlActions = null;
});
onNavigate(({ from, to }) => {
if (!embedded && to && from?.url.pathname !== to.url.pathname) loading = true;
});
$: if (!$user && (bridge?.connected || bridge?.connecting)) bridge.end();
$: if (selectedModelIds && $models && $config) bridge?.syncModel();