We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d4b8f58 commit 7baf353Copy full SHA for 7baf353
src/hooks/chat/useChat.ts
@@ -60,6 +60,7 @@ export function useChat(): UseChatReturn {
60
}
61
62
if (threadId && content.trim()) {
63
+ setInputText('') // Clear input text immediately
64
await dispatch(
65
addMessage({
66
threadId: threadId,
@@ -74,7 +75,6 @@ export function useChat(): UseChatReturn {
74
75
setIsSending(false)
76
return { threadId: undefined, error } // Include error feedback
77
} finally {
- setInputText('') // Clear input text on successful send
78
79
abortControllerRef.current = null
80
0 commit comments