Skip to content

Commit c53cd78

Browse files
committed
refac
1 parent 9793315 commit c53cd78

1 file changed

Lines changed: 19 additions & 1 deletion

File tree

src/routes/+layout.svelte

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
import '../app.css';
5050
import 'tippy.js/dist/tippy.css';
5151
52-
import { executeToolServer, getBackendConfig, getVersion } from '$lib/apis';
52+
import { executeToolServer, getBackendConfig, getModels, getVersion } from '$lib/apis';
5353
import { getSessionUser, userSignOut } from '$lib/apis/auths';
5454
import { getAllTags, getChatList } from '$lib/apis/chats';
5555
import { chatCompletion } from '$lib/apis/openai';
@@ -704,6 +704,24 @@
704704
location.reload();
705705
return;
706706
}
707+
if (event.type === 'page:navigate' && event.data?.path) {
708+
await goto(event.data.path);
709+
return;
710+
}
711+
if (event.type === 'models:refresh') {
712+
const token = localStorage.token;
713+
if (token) {
714+
models.set(
715+
await getModels(
716+
token,
717+
$config?.features?.enable_direct_connections
718+
? ($settings?.directConnections ?? null)
719+
: null
720+
)
721+
);
722+
}
723+
return;
724+
}
707725
708726
const token = localStorage.token;
709727
if (!token) return;

0 commit comments

Comments
 (0)