fix: modal not closing in many model chat

This commit is contained in:
Timothy J. Baek 2024-08-07 14:47:43 +02:00
parent 0c231fd387
commit 7e473f194d

View File

@ -118,19 +118,18 @@
currentMessageId = message.id;
let messageId = message.id;
console.log(messageId);
//
let messageChildrenIds = history.messages[messageId].childrenIds;
while (messageChildrenIds.length !== 0) {
messageId = messageChildrenIds.at(-1);
messageChildrenIds = history.messages[messageId].childrenIds;
}
history.currentId = messageId;
dispatch('change');
}
}}
>
{#key history.currentId}
<ResponseMessage
message={groupedMessages[model].messages[groupedMessagesIdx[model]]}
siblings={groupedMessages[model].messages.map((m) => m.id)}
@ -159,6 +158,7 @@
});
}}
/>
{/key}
</div>
{/if}
{/each}