refac: regenerate behaviour

This commit is contained in:
Timothy J. Baek 2024-05-19 05:53:43 -07:00
parent b9b25f872d
commit 120f8d7786
3 changed files with 16 additions and 3 deletions

View File

@ -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;

View File

@ -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);
}
}
};

View File

@ -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);
}
}
};