This commit is contained in:
Timothy Jaeryang Baek 2024-11-11 00:49:43 -08:00
parent 3b4ee0f127
commit ad49ad8fa4

View File

@ -141,7 +141,7 @@
})(); })();
} }
$: if (selectedModels) { $: if (selectedModels && chatIdProp !== '') {
saveSessionSelectedModels(); saveSessionSelectedModels();
} }
@ -149,9 +149,6 @@
if (selectedModels.length === 0 || (selectedModels.length === 1 && selectedModels[0] === '')) { if (selectedModels.length === 0 || (selectedModels.length === 1 && selectedModels[0] === '')) {
return; return;
} }
if (chatIdProp === '') {
return;
}
sessionStorage.selectedModels = JSON.stringify(selectedModels); sessionStorage.selectedModels = JSON.stringify(selectedModels);
console.log('saveSessionSelectedModels', selectedModels, sessionStorage.selectedModels); console.log('saveSessionSelectedModels', selectedModels, sessionStorage.selectedModels);
}; };
@ -913,6 +910,7 @@
const chatInput = document.getElementById('chat-input'); const chatInput = document.getElementById('chat-input');
chatInput?.focus(); chatInput?.focus();
saveSessionSelectedModels();
_responses = await sendPrompt(userPrompt, userMessageId, { newChat: true }); _responses = await sendPrompt(userPrompt, userMessageId, { newChat: true });
return _responses; return _responses;