From 319959ad6e0647ac2f74fa1a52a4b8ea486b923c Mon Sep 17 00:00:00 2001 From: wsw <944627549@qq.com> Date: Thu, 4 May 2023 22:53:22 +0800 Subject: [PATCH] refactor: determine userInput by trimming --- app/components/chat.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/components/chat.tsx b/app/components/chat.tsx index 4173fc3a..ca51a06a 100644 --- a/app/components/chat.tsx +++ b/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);