Explorar o código

Merge pull request #1248 from wsw2000/main

refactor: determine userInput by trimming
Yifei Zhang hai 1 ano
pai
achega
ec655f5182
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  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);