From 78272aed8dc5c3ab82c2bdb3cbd9ec4b57459c73 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Sun, 9 Jun 2024 17:20:23 -0700 Subject: [PATCH] fix --- src/lib/components/chat/Chat.svelte | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/src/lib/components/chat/Chat.svelte b/src/lib/components/chat/Chat.svelte index bc9aff095..affee88a7 100644 --- a/src/lib/components/chat/Chat.svelte +++ b/src/lib/components/chat/Chat.svelte @@ -296,16 +296,6 @@ ////////////////////////// const submitPrompt = async (userPrompt, _user = null) => { - // Reset chat input textarea - const chatTextAreaElement = document.getElementById('chat-textarea'); - - if (chatTextAreaElement) { - chatTextAreaElement.value = ''; - chatTextAreaElement.style.height = ''; - } - - prompt = ''; - let _responses = []; console.log('submitPrompt', $chatId); @@ -329,8 +319,15 @@ ) ); } else { - // Reset chat message textarea height - document.getElementById('chat-textarea').style.height = ''; + // Reset chat input textarea + const chatTextAreaElement = document.getElementById('chat-textarea'); + + if (chatTextAreaElement) { + chatTextAreaElement.value = ''; + chatTextAreaElement.style.height = ''; + } + + prompt = ''; // Create user message let userMessageId = uuidv4();