Skip to content

Commit 7baf353

Browse files
jnoorulamrmelsayed
authored andcommitted
#57 clear the question after send
1 parent d4b8f58 commit 7baf353

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/hooks/chat/useChat.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ export function useChat(): UseChatReturn {
6060
}
6161
}
6262
if (threadId && content.trim()) {
63+
setInputText('') // Clear input text immediately
6364
await dispatch(
6465
addMessage({
6566
threadId: threadId,
@@ -74,7 +75,6 @@ export function useChat(): UseChatReturn {
7475
setIsSending(false)
7576
return { threadId: undefined, error } // Include error feedback
7677
} finally {
77-
setInputText('') // Clear input text on successful send
7878
setIsSending(false)
7979
abortControllerRef.current = null
8080
}

0 commit comments

Comments
 (0)