forked from XiaoMo/ChatGPT-Next-Web
refactor: determine userInput by trimming
This commit is contained in:
parent
6c1261d28d
commit
319959ad6e
@ -480,7 +480,7 @@ export function Chat() {
|
|||||||
|
|
||||||
// submit user input
|
// submit user input
|
||||||
const onUserSubmit = () => {
|
const onUserSubmit = () => {
|
||||||
if (userInput.length <= 0) return;
|
if (userInput.trim() === "") return;
|
||||||
setIsLoading(true);
|
setIsLoading(true);
|
||||||
chatStore.onUserInput(userInput).then(() => setIsLoading(false));
|
chatStore.onUserInput(userInput).then(() => setIsLoading(false));
|
||||||
setBeforeInput(userInput);
|
setBeforeInput(userInput);
|
||||||
|
Loading…
Reference in New Issue
Block a user