mirror of
https://github.com/open-webui/open-webui
synced 2025-06-26 18:26:48 +00:00
Merge pull request #13832 from Ithanil/svelte_versioning
feat: Handle frontend updates according to Svelte docs
This commit is contained in:
@@ -49,6 +49,16 @@
|
||||
import AppSidebar from '$lib/components/app/AppSidebar.svelte';
|
||||
import { chatCompletion } from '$lib/apis/openai';
|
||||
|
||||
import { beforeNavigate } from '$app/navigation';
|
||||
import { updated } from '$app/state';
|
||||
|
||||
// handle frontend updates (https://svelte.dev/docs/kit/configuration#version)
|
||||
beforeNavigate(({ willUnload, to }) => {
|
||||
if (updated.current && !willUnload && to?.url) {
|
||||
location.href = to.url.href;
|
||||
}
|
||||
});
|
||||
|
||||
setContext('i18n', i18n);
|
||||
|
||||
const bc = new BroadcastChannel('active-tab-channel');
|
||||
|
||||
Reference in New Issue
Block a user