Skip to content

Commit 911ea9a

Browse files
committed
fix: use channel method for sending events
1 parent 2fa5975 commit 911ea9a

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

package/src/components/MessageInput/MessageInput.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -733,10 +733,7 @@ const MessageInputWithContext = <
733733
const { channel } = useChannelContext<StreamChatGenerics>();
734734
const { aiState } = useAIState(channel);
735735

736-
const stopGenerating = useCallback(
737-
() => channel.sendEvent({ type: 'ai_indicator.stop' }),
738-
[channel],
739-
);
736+
const stopGenerating = useCallback(() => channel?.stopAIResponse(), [channel]);
740737
const shouldDisplayStopAIGeneration = [AIStates.Thinking, AIStates.Generating].includes(aiState);
741738

742739
return (

0 commit comments

Comments
 (0)