fix: many model chat actions not working

This commit is contained in:
Timothy J. Baek 2024-08-21 22:54:56 +02:00
parent 4a21c5c5e7
commit f3f6941205
2 changed files with 12 additions and 0 deletions

View File

@ -386,6 +386,15 @@
{continueGeneration} {continueGeneration}
{mergeResponses} {mergeResponses}
{regenerateResponse} {regenerateResponse}
on:action={async (e) => {
console.log('action', e);
if (typeof e.detail === 'string') {
await chatActionHandler(chatId, e.detail, message.model, message.id);
} else {
const { id, event } = e.detail;
await chatActionHandler(chatId, id, message.model, message.id, event);
}
}}
on:change={async () => { on:change={async () => {
await updateChatById(localStorage.token, chatId, { await updateChatById(localStorage.token, chatId, {
messages: messages, messages: messages,

View File

@ -186,6 +186,9 @@
await tick(); await tick();
groupedMessagesIdx[modelIdx] = groupedMessages[modelIdx].messages.length - 1; groupedMessagesIdx[modelIdx] = groupedMessages[modelIdx].messages.length - 1;
}} }}
on:action={async (e) => {
dispatch('action', e.detail);
}}
on:save={async (e) => { on:save={async (e) => {
console.log('save', e); console.log('save', e);