From 81bfb97c91e72a24e74bddc7ec818d98a6f73920 Mon Sep 17 00:00:00 2001 From: Brandon Hulston Date: Wed, 17 Jan 2024 02:07:29 -0700 Subject: [PATCH] Make sure model is saved in DB for imported chats (or chats with no model saved already) --- src/routes/(app)/c/[id]/+page.svelte | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/routes/(app)/c/[id]/+page.svelte b/src/routes/(app)/c/[id]/+page.svelte index 314cc7b6b..593a7a78c 100644 --- a/src/routes/(app)/c/[id]/+page.svelte +++ b/src/routes/(app)/c/[id]/+page.svelte @@ -200,8 +200,15 @@ await chatId.set('local'); } await tick(); - } + } else if (chat.chat["models"][0] == "") { + // If model is not saved in DB, then save selectedmodel when message is sent + chat = await updateChatById(localStorage.token, $chatId, { + models: selectedModels + }); + await chats.set(await getChatList(localStorage.token)); + } + // Reset chat input textarea prompt = ''; files = [];