|
@@ -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');
|