Timothy Jaeryang Baek 3 tuần trước cách đây
mục cha
commit
8b8908fa93

+ 7 - 2
src/lib/components/chat/MessageInput.svelte

@@ -284,12 +284,17 @@
 		const chatInput = document.getElementById('chat-input');
 		const chatInput = document.getElementById('chat-input');
 
 
 		if (chatInput) {
 		if (chatInput) {
-			text = await textVariableHandler(text || '');
+			if (text !== '') {
+				text = await textVariableHandler(text || '');
+			}
 
 
 			chatInputElement?.setText(text);
 			chatInputElement?.setText(text);
 			chatInputElement?.focus();
 			chatInputElement?.focus();
 
 
-			text = await inputVariableHandler(text);
+			if (text !== '') {
+				text = await inputVariableHandler(text);
+			}
+
 			await tick();
 			await tick();
 			if (cb) await cb(text);
 			if (cb) await cb(text);
 		}
 		}