Skip to content

Commit 1d6bf19

Browse files
authored
fix(revert): ensure the call is joined before notifying readiness (#2194)
Reverts #2180 ref: https://getstream.slack.com/archives/C06LKRKGZGQ/p1775731955118119
1 parent f4fdd9e commit 1d6bf19

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

sample-apps/react/egress-composite/src/hooks/useNotifyEgress.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import {
66
useEffect,
77
useState,
88
} from 'react';
9-
import { CallingState, useCallStateHooks } from '@stream-io/video-react-sdk';
109

1110
const EgressReadyNotificationContext = createContext((isReady: boolean) => {
1211
// no-op
@@ -15,13 +14,10 @@ const EgressReadyNotificationContext = createContext((isReady: boolean) => {
1514

1615
export const EgressReadyNotificationProvider = (props: PropsWithChildren) => {
1716
const [isReady, setIsReady] = useState(false);
18-
const { useCallCallingState } = useCallStateHooks();
19-
const callingState = useCallCallingState();
2017
useEffect(() => {
21-
if (isReady || callingState !== CallingState.JOINED) return;
18+
if (isReady) return;
2219
// it could happen that components won't notify us that they are ready
2320
// in that case, we start recording anyway after 4 seconds.
24-
console.log('Egress: Started waiting for components to notify readiness');
2521
const timeout = setTimeout(() => {
2622
if (!isReady) {
2723
console.log('Timeout: Egress is ready');
@@ -32,7 +28,7 @@ export const EgressReadyNotificationProvider = (props: PropsWithChildren) => {
3228
return () => {
3329
clearTimeout(timeout);
3430
};
35-
}, [callingState, isReady]);
31+
}, [isReady]);
3632

3733
const spyIsReady = useCallback((value: boolean) => {
3834
setIsReady((current) => {

0 commit comments

Comments
 (0)