From 88e78b7819b28ffe91f3dff24d8c5d992004197e Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Wed, 16 Sep 2026 08:35:01 -0400 Subject: [PATCH] refac --- src/lib/components/chat/Chat.svelte | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/lib/components/chat/Chat.svelte b/src/lib/components/chat/Chat.svelte index 2eb24716d4..73aa79a570 100644 --- a/src/lib/components/chat/Chat.svelte +++ b/src/lib/components/chat/Chat.svelte @@ -1250,10 +1250,13 @@ updateLastReadAt($chatId); } } - } else if (type === 'response:completion') { - responseCompletionEventHandler(data, message); - } else if (type === 'chat:completion') { - chatCompletionEventHandler(data, message, event.chat_id); + } else if (type === 'response:completion' || type === 'chat:completion') { + if (type === 'response:completion') { + responseCompletionEventHandler(data, message); + } else { + await chatCompletionEventHandler(data, message, event.chat_id); + } + autoScrollToBottom(); } else if (type === 'chat:tasks:cancel') { dismissContextCompactionToast(); if (data?.output) { @@ -2766,7 +2769,6 @@ history.messages[message.id] = message; history = history; - autoScrollToBottom(); }; const chatCompletionEventHandler = async (data, message, chatId) => { @@ -2884,9 +2886,6 @@ } console.log(data); - await tick(); - - autoScrollToBottom(); }; //////////////////////////