This commit is contained in:
Timothy Jaeryang Baek committed 2026-12-01 00:33:38 +04:00
1 parent 1e177c2bd0
commit 55f1b5c0cb
3 files changed
+13 -8

No files matched your search

+4 -1
View File
@@ -2077,7 +2077,10 @@
$: mainChatActive = fullWidth && visibleTabIds.has(mainChatTabId);
$: if (isMounted && viewReady && !chatLoading) {
const active = tabs.tabs.find((tab) => tab.id === tabs.activeId);
const main = active?.id === mainChatTabId || (active?.kind === 'chat' && isSavedChatId(chatId));
// A chat tab beside the main chat keeps its address; one covering it has its own.
const main =
active?.id === mainChatTabId ||
(active?.kind === 'chat' && isSavedChatId(chatId) && mainChatActive);
const href =
active?.kind === 'page'
? active.href
+1 -7
View File
@@ -2,7 +2,6 @@
import { getContext, setContext, type ComponentType, type SvelteComponent } from 'svelte';
import { writable } from 'svelte/store';
import { goto } from '$app/navigation';
import { updated } from '$app/state';
import { config, user, WEBUI_NAME } from '$lib/stores';
import { type PageContext } from '$lib/utils/page';
import { pageTabKey } from './tabs';
@@ -112,12 +111,7 @@
['knowledge', 'prompts'].includes(parts[2])
? { showCreateOnMount: true, createModalCloseHref: `/workspace/${parts[2]}` }
: {};
$: component =
key &&
pages[route as keyof typeof pages]?.().catch(async (error) => {
if (await updated.check()) location.reload();
throw error;
});
$: component = key && pages[route as keyof typeof pages]?.();
$: allowed =
(parts[1] !== 'notes' ||
($config?.features?.enable_notes &&
+8
View File
@@ -104,6 +104,14 @@
}
});
// a lazily loaded chunk from the old build is gone after an update (https://vite.dev/guide/build#load-error-handling)
window.addEventListener('vite:preloadError', async () => {
if (!mfaManagement && (await updated.check())) {
await unregisterServiceWorkers();
location.reload();
}
});
setContext('i18n', i18n);
/** @type {import('$lib/components/auth/MfaManagement.svelte').MfaManagementFlow | null} */
let mfaManagement = null;