Skip to content

Commit 84c7854

Browse files
committed
chore: update event names as per the changes
1 parent 26947cf commit 84c7854

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

package/src/components/AITypingIndicatorView/hooks/useAIState.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,17 @@ export const useAIState = <
3333
}
3434

3535
const indicatorChangedListener = channel.on(
36-
'ai_indicator_changed',
36+
'ai_indicator.update',
3737
(event: Event<StreamChatGenerics>) => {
3838
const { cid } = event;
39-
const state = event.state as AIStateType;
39+
const state = event.ai_state as AIStateType;
4040
if (channel.cid === cid) {
4141
setAiState(state);
4242
}
4343
},
4444
);
4545

46-
const indicatorClearedListener = channel.on('ai_indicator_clear', (event) => {
46+
const indicatorClearedListener = channel.on('ai_indicator.clear', (event) => {
4747
const { cid } = event;
4848
if (channel.cid === cid) {
4949
setAiState(AIStates.Idle);

package/src/components/MessageInput/MessageInput.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -734,7 +734,7 @@ const MessageInputWithContext = <
734734
const { aiState } = useAIState(channel);
735735

736736
const stopGenerating = useCallback(
737-
() => channel.sendEvent({ type: 'stop_generating' }),
737+
() => channel.sendEvent({ type: 'ai_indicator.stop' }),
738738
[channel],
739739
);
740740
const shouldDisplayStopAIGeneration = [AIStates.Thinking, AIStates.Generating].includes(aiState);

0 commit comments

Comments
 (0)