diff --git a/src/lib/components/chat/Messages.svelte b/src/lib/components/chat/Messages.svelte index 1a9ca373f..f805c83e3 100644 --- a/src/lib/components/chat/Messages.svelte +++ b/src/lib/components/chat/Messages.svelte @@ -355,7 +355,12 @@ copyToClipboard={copyToClipboardWithToast} {continueGeneration} {regenerateResponse} - on:change={() => { + on:change={async () => { + await updateChatById(localStorage.token, chatId, { + messages: messages, + history: history + }); + const element = document.getElementById('messages-container'); autoScroll = element.scrollHeight - element.scrollTop <= element.clientHeight + 50; diff --git a/src/routes/(app)/+page.svelte b/src/routes/(app)/+page.svelte index 013f5d196..db3daf47a 100644 --- a/src/routes/(app)/+page.svelte +++ b/src/routes/(app)/+page.svelte @@ -766,7 +766,11 @@ let userMessage = history.messages[message.parentId]; let userPrompt = userMessage.content; - await sendPrompt(userPrompt, userMessage.id, message.model); + if ((userMessage?.models ?? [...selectedModels]).length == 1) { + await sendPrompt(userPrompt, userMessage.id); + } else { + await sendPrompt(userPrompt, userMessage.id, message.model); + } } }; diff --git a/src/routes/(app)/c/[id]/+page.svelte b/src/routes/(app)/c/[id]/+page.svelte index b002d9971..d330aadb3 100644 --- a/src/routes/(app)/c/[id]/+page.svelte +++ b/src/routes/(app)/c/[id]/+page.svelte @@ -771,7 +771,11 @@ let userMessage = history.messages[message.parentId]; let userPrompt = userMessage.content; - await sendPrompt(userPrompt, userMessage.id, message.model); + if ((userMessage?.models ?? [...selectedModels]).length == 1) { + await sendPrompt(userPrompt, userMessage.id); + } else { + await sendPrompt(userPrompt, userMessage.id, message.model); + } } };