diff --git a/src/lib/components/chat/Messages/MultiResponseMessages.svelte b/src/lib/components/chat/Messages/MultiResponseMessages.svelte index 83ca78b3d..1bd4b8875 100644 --- a/src/lib/components/chat/Messages/MultiResponseMessages.svelte +++ b/src/lib/components/chat/Messages/MultiResponseMessages.svelte @@ -129,7 +129,7 @@ } else { return { ...a, - [modelIdx]: 0 + [modelIdx]: groupedMessageIds[modelIdx].messageIds.length - 1 }; } }, {}); @@ -149,7 +149,14 @@ }; onMount(async () => { - initHandler(); + await initHandler(); + await tick(); + + const messageElement = document.getElementById(`message-${messageId}`); + console.log(messageElement); + if (messageElement) { + messageElement.scrollIntoView({ behavior: 'smooth', block: 'center' }); + } });