mirror of
https://github.com/open-webui/open-webui.git
synced 2026-11-30 00:45:12 -05:00
fix: cancelling "Discard unsaved changes?" no longer leaves the main chat blank (#34300)
This commit is contained in:
1 file changed
+5
-3
@@ -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();
|
||||
|
||||
|
||||
Reference in new issue
Block a user