From b4e884859d3c8ef877bfe9b4357df1bf8b8b9bfe Mon Sep 17 00:00:00 2001 From: Santhosh Vaiyapuri Date: Mon, 4 Dec 2023 17:25:13 +0100 Subject: [PATCH] fix(rn-dogfood): unnecessary rerender on call leave --- .../react-native/dogfood/src/components/MeetingUI.tsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sample-apps/react-native/dogfood/src/components/MeetingUI.tsx b/sample-apps/react-native/dogfood/src/components/MeetingUI.tsx index 0c03a19116..9e1a23e015 100644 --- a/sample-apps/react-native/dogfood/src/components/MeetingUI.tsx +++ b/sample-apps/react-native/dogfood/src/components/MeetingUI.tsx @@ -62,11 +62,9 @@ export const MeetingUI = ({ callId, navigation, route }: Props) => { const onHangupCallHandler = async () => { setShow('loading'); try { - if (callingState === CallingState.LEFT) { - return; + if (callingState !== CallingState.LEFT) { + await call?.leave(); } - await call?.leave(); - setShow('lobby'); navigation.goBack(); } catch (error) { if (error instanceof Error) {