diff --git a/sample-apps/react/egress-composite/src/hooks/useNotifyEgress.tsx b/sample-apps/react/egress-composite/src/hooks/useNotifyEgress.tsx index e4a013748b..1748dd779f 100644 --- a/sample-apps/react/egress-composite/src/hooks/useNotifyEgress.tsx +++ b/sample-apps/react/egress-composite/src/hooks/useNotifyEgress.tsx @@ -6,7 +6,6 @@ import { useEffect, useState, } from 'react'; -import { CallingState, useCallStateHooks } from '@stream-io/video-react-sdk'; const EgressReadyNotificationContext = createContext((isReady: boolean) => { // no-op @@ -15,13 +14,10 @@ const EgressReadyNotificationContext = createContext((isReady: boolean) => { export const EgressReadyNotificationProvider = (props: PropsWithChildren) => { const [isReady, setIsReady] = useState(false); - const { useCallCallingState } = useCallStateHooks(); - const callingState = useCallCallingState(); useEffect(() => { - if (isReady || callingState !== CallingState.JOINED) return; + if (isReady) return; // it could happen that components won't notify us that they are ready // in that case, we start recording anyway after 4 seconds. - console.log('Egress: Started waiting for components to notify readiness'); const timeout = setTimeout(() => { if (!isReady) { console.log('Timeout: Egress is ready'); @@ -32,7 +28,7 @@ export const EgressReadyNotificationProvider = (props: PropsWithChildren) => { return () => { clearTimeout(timeout); }; - }, [callingState, isReady]); + }, [isReady]); const spyIsReady = useCallback((value: boolean) => { setIsReady((current) => {