Browse Source

fix: message input delay

Timothy J. Baek 11 months ago
parent
commit
bb15eb016e
1 changed files with 5 additions and 4 deletions
  1. 5 4
      src/lib/components/chat/Chat.svelte

+ 5 - 4
src/lib/components/chat/Chat.svelte

@@ -294,10 +294,14 @@
 	};
 
 	//////////////////////////
-	// Ollama functions
+	// Chat functions
 	//////////////////////////
 
 	const submitPrompt = async (userPrompt, _user = null) => {
+		// Reset chat input textarea
+		prompt = '';
+		document.getElementById('chat-textarea').style.height = '';
+
 		let _responses = [];
 		console.log('submitPrompt', $chatId);
 
@@ -374,9 +378,6 @@
 				await tick();
 			}
 
-			// Reset chat input textarea
-			prompt = '';
-			document.getElementById('chat-textarea').style.height = '';
 			files = [];
 
 			// Send prompt