From 0db0b8ce2cc4a8f9f723ee63818fb9b27a94a78d Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Thu, 19 Dec 2024 12:19:06 -0800 Subject: [PATCH] fix --- src/lib/components/chat/MessageInput.svelte | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/lib/components/chat/MessageInput.svelte b/src/lib/components/chat/MessageInput.svelte index 51fbf5804..1c0b31c1e 100644 --- a/src/lib/components/chat/MessageInput.svelte +++ b/src/lib/components/chat/MessageInput.svelte @@ -727,14 +727,14 @@ ...document.getElementsByClassName('user-message') ]?.at(-1); - const editButton = [ - ...document.getElementsByClassName('edit-user-message-button') - ]?.at(-1); + if (userMessageElement) { + userMessageElement.scrollIntoView({ block: 'center' }); + const editButton = [ + ...document.getElementsByClassName('edit-user-message-button') + ]?.at(-1); - console.log(userMessageElement); - - userMessageElement.scrollIntoView({ block: 'center' }); - editButton?.click(); + editButton?.click(); + } } if (commandsContainerElement) {