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;