From 05e50a4a9e2bffaddc1f4f096faefa78cf06aede Mon Sep 17 00:00:00 2001 From: GleidsonDaniel Date: Wed, 3 May 2023 08:55:10 -0300 Subject: [PATCH] fix goback ios --- app/views/JitsiMeetView.tsx | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/app/views/JitsiMeetView.tsx b/app/views/JitsiMeetView.tsx index fcaa9a75e..9b5f5e4d7 100644 --- a/app/views/JitsiMeetView.tsx +++ b/app/views/JitsiMeetView.tsx @@ -2,10 +2,11 @@ import { activateKeepAwake, deactivateKeepAwake } from 'expo-keep-awake'; import React from 'react'; import { BackHandler, Linking, NativeEventSubscription, SafeAreaView } from 'react-native'; import WebView from 'react-native-webview'; -import { WebViewMessage, WebViewNavigation } from 'react-native-webview/lib/WebViewTypes'; +import { WebViewNavigation } from 'react-native-webview/lib/WebViewTypes'; import { IBaseScreen } from '../definitions'; import { userAgent } from '../lib/constants'; +import { isIOS } from '../lib/methods/helpers'; import { events, logEvent } from '../lib/methods/helpers/log'; import { endVideoConfTimer, initVideoConfTimer } from '../lib/methods/videoConfTimer'; import { ChatsStackParamList } from '../stacks/types'; @@ -64,14 +65,20 @@ class JitsiMeetView extends React.Component { } }; - onNavigationStateChange = (webViewState: WebViewNavigation | WebViewMessage) => { + onNavigationStateChange = (webViewState: WebViewNavigation) => { const { navigation, route } = this.props; const jitsiRoomId = route.params.url ?.split(/^https?:\/\//)[1] ?.split('#')[0] ?.split('/')[1]; if ((jitsiRoomId && !webViewState.url.includes(jitsiRoomId)) || webViewState.url.includes('close')) { - navigation.pop(); + if (isIOS) { + if (webViewState.navigationType) { + navigation.pop(); + } + } else { + navigation.pop(); + } } }; @@ -80,7 +87,6 @@ class JitsiMeetView extends React.Component { this.onNavigationStateChange(nativeEvent)} onNavigationStateChange={this.onNavigationStateChange} style={{ flex: 1 }} userAgent={userAgent}