From 5296ee0f713f84b3fbf44317e2587ae48b6f4fbb Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Sat, 5 Apr 2025 11:24:05 -0600 Subject: [PATCH] refac --- src/lib/components/chat/Chat.svelte | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/components/chat/Chat.svelte b/src/lib/components/chat/Chat.svelte index 2b378271d..2ee588985 100644 --- a/src/lib/components/chat/Chat.svelte +++ b/src/lib/components/chat/Chat.svelte @@ -1322,10 +1322,6 @@ history.messages[messages.at(-1).id].childrenIds.push(userMessageId); } - if (autoScroll) { - scrollToBottom(); - } - // focus on chat input const chatInput = document.getElementById('chat-input'); chatInput?.focus(); @@ -1341,6 +1337,10 @@ parentId: string, { modelId = null, modelIdx = null, newChat = false } = {} ) => { + if (autoScroll) { + scrollToBottom(); + } + let _chatId = JSON.parse(JSON.stringify($chatId)); _history = JSON.parse(JSON.stringify(_history));