From 9a40fe46b34cfb191c04cbe999fba59aecb94841 Mon Sep 17 00:00:00 2001 From: Kristian Martinoski Date: Thu, 26 Dec 2024 15:52:42 +0100 Subject: [PATCH] fixes error/warning when the call is left in expo --- .../react-native/expo-video-sample/app/meeting.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sample-apps/react-native/expo-video-sample/app/meeting.tsx b/sample-apps/react-native/expo-video-sample/app/meeting.tsx index 85fb0c606a..149587ebcd 100644 --- a/sample-apps/react-native/expo-video-sample/app/meeting.tsx +++ b/sample-apps/react-native/expo-video-sample/app/meeting.tsx @@ -1,14 +1,20 @@ import { StreamCall, useCalls } from '@stream-io/video-react-native-sdk'; import { router } from 'expo-router'; import { MeetingUI } from '../components/MeetingUI'; +import { useEffect } from 'react'; export default function JoinMeetingScreen() { const calls = useCalls().filter((c) => !c.ringing); const firstCall = calls[0]; + useEffect(() => { + if (!firstCall) { + router.back(); + } + }, [firstCall]); + if (!firstCall) { - router.back(); return null; }