From 6a2c1600f559967f14463966574ec0dc06bd2d89 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Sun, 19 Nov 2023 20:39:13 -0800 Subject: [PATCH] fix: new chat load --- src/lib/components/chat/SettingsModal.svelte | 6 +++-- src/lib/components/layout/Navbar.svelte | 9 +++++-- src/lib/components/layout/Sidebar.svelte | 8 ++++-- src/routes/(app)/+page.svelte | 9 ++++--- src/routes/(app)/c/[id]/+page.svelte | 26 +++++++++++--------- 5 files changed, 37 insertions(+), 21 deletions(-) diff --git a/src/lib/components/chat/SettingsModal.svelte b/src/lib/components/chat/SettingsModal.svelte index 2e951e01..95495b7c 100644 --- a/src/lib/components/chat/SettingsModal.svelte +++ b/src/lib/components/chat/SettingsModal.svelte @@ -50,10 +50,12 @@ if (API_BASE_URL === '') { API_BASE_URL = BUILD_TIME_API_BASE_URL; } - const res = await getModels(API_BASE_URL, 'ollama'); + const _models = await getModels(API_BASE_URL, 'ollama'); - if (res) { + if (_models.length > 0) { toast.success('Server connection verified'); + await models.set(_models); + saveSettings({ API_BASE_URL: API_BASE_URL }); diff --git a/src/lib/components/layout/Navbar.svelte b/src/lib/components/layout/Navbar.svelte index eb11d028..9bf15a07 100644 --- a/src/lib/components/layout/Navbar.svelte +++ b/src/lib/components/layout/Navbar.svelte @@ -1,5 +1,8 @@ @@ -14,8 +17,10 @@