Merge pull request #1248 from wsw2000/main

refactor: determine userInput by trimming
This commit is contained in:
Yifei Zhang 2023-05-04 23:26:02 +08:00 committed by GitHub
commit ec655f5182
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);