Skip to content

Commit 01139bc

Browse files
committed
chore: update event names as per the changes
1 parent 0722e98 commit 01139bc

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/components/AITypingIndicatorView/hooks/useAIState.ts

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

3535
const indicatorChangedListener = channel.on(
36-
// @ts-ignore
37-
'ai_indicator_changed',
36+
'ai_indicator.update',
3837
(event: Event<StreamChatGenerics>) => {
3938
const { cid } = event;
40-
const state = event.state as AIStateType;
39+
const state = event.ai_state as AIStateType;
4140
if (channel.cid === cid) {
4241
setAiState(state);
4342
}
4443
},
4544
);
4645

4746
// @ts-ignore
48-
const indicatorClearedListener = channel.on('ai_indicator_clear', (event) => {
47+
const indicatorClearedListener = channel.on('ai_indicator.clear', (event) => {
4948
const { cid } = event;
5049
if (channel.cid === cid) {
5150
setAiState(AIStates.Idle);

src/components/MessageInput/MessageInputFlat.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,7 @@ export const MessageInputFlat = <
8181

8282
const { aiState } = useAIState(channel);
8383

84-
// @ts-ignore
85-
const stopGenerating = useCallback(() => channel?.sendEvent({ type: 'stop_generating' }), [
84+
const stopGenerating = useCallback(() => channel?.sendEvent({ type: 'ai_indicator.stop' }), [
8685
channel,
8786
]);
8887

0 commit comments

Comments
 (0)