Browse Source

refactor: determine userInput by trimming

wsw 1 năm trước cách đây
mục cha
commit
319959ad6e
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      app/components/chat.tsx

+ 1 - 1
app/components/chat.tsx

@@ -480,7 +480,7 @@ export function Chat() {
 
   // submit user input
   const onUserSubmit = () => {
-    if (userInput.length <= 0) return;
+    if (userInput.trim() === "") return;
     setIsLoading(true);
     chatStore.onUserInput(userInput).then(() => setIsLoading(false));
     setBeforeInput(userInput);