From dfde08aa7391d924359b27f5768411d7a533a6ec Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Tue, 15 Sep 2026 23:53:41 -0400 Subject: [PATCH] refac --- src/lib/components/chat/Chat.svelte | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/lib/components/chat/Chat.svelte b/src/lib/components/chat/Chat.svelte index ac75fd57bc..2eb24716d4 100644 --- a/src/lib/components/chat/Chat.svelte +++ b/src/lib/components/chat/Chat.svelte @@ -2460,7 +2460,7 @@ let scrollRAF = null; let contentsRAF = null; - const scheduleResponseScrollToBottom = () => { + const autoScrollToBottom = () => { if (!shouldAutoScrollResponse()) return; if (!scrollRAF) { @@ -2766,6 +2766,7 @@ history.messages[message.id] = message; history = history; + autoScrollToBottom(); }; const chatCompletionEventHandler = async (data, message, chatId) => { @@ -2885,7 +2886,7 @@ console.log(data); await tick(); - scheduleResponseScrollToBottom(); + autoScrollToBottom(); }; ////////////////////////// @@ -3931,7 +3932,7 @@ history.messages[messageId] = message; } - scheduleResponseScrollToBottom(); + autoScrollToBottom(); } await saveChatHandler(_chatId, history);