diff --git a/sample-apps/react/react-dogfood/components/CallRecordingsPage/CallRecordingsPage.tsx b/sample-apps/react/react-dogfood/components/CallRecordingsPage/CallRecordingsPage.tsx index 9db58f91f5..1689aea982 100644 --- a/sample-apps/react/react-dogfood/components/CallRecordingsPage/CallRecordingsPage.tsx +++ b/sample-apps/react/react-dogfood/components/CallRecordingsPage/CallRecordingsPage.tsx @@ -35,13 +35,16 @@ export const CallRecordingsPage = ({ }); setVideoClient(_client); + // @ts-ignore - for debugging + window.client = _client; + return () => { _client .disconnectUser() .catch((e) => console.error(`Couldn't disconnect user`, e)); setVideoClient(undefined); }; - }, []); + }, [apiKey, user, userToken]); if (!videoClient) { return null; diff --git a/sample-apps/react/react-dogfood/pages/guest/join/[guestCallId].tsx b/sample-apps/react/react-dogfood/pages/guest/join/[guestCallId].tsx index 3321696f2b..f0dfc77ac4 100644 --- a/sample-apps/react/react-dogfood/pages/guest/join/[guestCallId].tsx +++ b/sample-apps/react/react-dogfood/pages/guest/join/[guestCallId].tsx @@ -33,7 +33,6 @@ export default function GuestCallRoom(props: GuestCallRoomProps) { const guestUserId = (router.query['guest_user_id'] as string) || 'Guest'; const [client, setClient] = useState(); - useEffect(() => { const userToConnect: User = mode === 'anon' @@ -51,20 +50,25 @@ export default function GuestCallRoom(props: GuestCallRoomProps) { }); setClient(_client); + // @ts-ignore - for debugging + window.client = _client; + return () => { _client .disconnectUser() .catch((e) => console.error('Failed to disconnect user', e)); setClient(undefined); }; - }, []); + }, [apiKey, guestUserId, mode, token]); const [call, setCall] = useState(); - useEffect(() => { const _call = client?.call(callType, callId); setCall(_call); + // @ts-ignore - for debugging + window.call = _call; + return () => { if (_call?.state.callingState !== CallingState.LEFT) { _call?.leave();