fix: handle chat completion state with enter button (#1114)

This commit is contained in:
Louis 2023-12-20 14:59:40 +07:00 committed by GitHub
parent c68d0371a0
commit a485fa9c1f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -86,7 +86,9 @@ const ChatScreen = () => {
if (e.key === 'Enter') {
if (!e.shiftKey) {
e.preventDefault()
if (messages[messages.length - 1]?.status !== MessageStatus.Pending)
sendChatMessage()
else onStopInferenceClick()
}
}
}