From ad49ad8fa4cb1de3e88c37cbec9cd40d4b373817 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Mon, 11 Nov 2024 00:49:43 -0800 Subject: [PATCH] refac --- src/lib/components/chat/Chat.svelte | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/lib/components/chat/Chat.svelte b/src/lib/components/chat/Chat.svelte index 232879602..26f0498ff 100644 --- a/src/lib/components/chat/Chat.svelte +++ b/src/lib/components/chat/Chat.svelte @@ -141,7 +141,7 @@ })(); } - $: if (selectedModels) { + $: if (selectedModels && chatIdProp !== '') { saveSessionSelectedModels(); } @@ -149,9 +149,6 @@ if (selectedModels.length === 0 || (selectedModels.length === 1 && selectedModels[0] === '')) { return; } - if (chatIdProp === '') { - return; - } sessionStorage.selectedModels = JSON.stringify(selectedModels); console.log('saveSessionSelectedModels', selectedModels, sessionStorage.selectedModels); }; @@ -913,6 +910,7 @@ const chatInput = document.getElementById('chat-input'); chatInput?.focus(); + saveSessionSelectedModels(); _responses = await sendPrompt(userPrompt, userMessageId, { newChat: true }); return _responses;