Skip to content

Commit 644c3d2

Browse files
committed
fix: use top level state for user presence
1 parent 256462b commit 644c3d2

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { AIState, Channel, Event } from 'stream-chat';
44

55
import { useChatContext } from '../../../contexts';
66
import type { DefaultStreamChatGenerics } from '../../../types/types';
7-
import { useIsOnline } from '../../Chat/hooks/useIsOnline';
87

98
export const AIStates = {
109
Error: 'AI_STATE_ERROR',
@@ -24,8 +23,7 @@ export const useAIState = <
2423
>(
2524
channel?: Channel<StreamChatGenerics>,
2625
): { aiState: AIState } => {
27-
const { client } = useChatContext<StreamChatGenerics>();
28-
const { isOnline } = useIsOnline<StreamChatGenerics>(client);
26+
const { isOnline } = useChatContext<StreamChatGenerics>();
2927

3028
const [aiState, setAiState] = useState<AIState>(AIStates.Idle);
3129

0 commit comments

Comments
 (0)