Merge pull request #567 from leedom92/optimize-send-button

refactor: optimize component `IconButton`
This commit is contained in:
Yifei Zhang
2023-04-06 23:10:09 +08:00
committed by GitHub
3 changed files with 13 additions and 3 deletions

View File

@@ -404,7 +404,6 @@ export function Chat(props: {
// submit user input
const onUserSubmit = () => {
if (userInput.length <= 0) return;
setIsLoading(true);
chatStore.onUserInput(userInput).then(() => setIsLoading(false));
setUserInput("");
@@ -680,6 +679,7 @@ export function Chat(props: {
text={Locale.Chat.Send}
className={styles["chat-input-send"]}
noDark
disabled={!userInput}
onClick={onUserSubmit}
/>
</div>