Regression: Jitsi not leaving call properly (#4511)

This commit is contained in:
Gleidson Daniel Silva 2022-09-09 15:15:08 -03:00 committed by GitHub
parent cf7b9a09f4
commit 6484edddb6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 2 deletions

View File

@ -1,5 +1,5 @@
import React from 'react';
import { StyleSheet } from 'react-native';
import { BackHandler, StyleSheet } from 'react-native';
import JitsiMeet, { JitsiMeetView as RNJitsiMeetView } from 'react-native-jitsi-meet';
import BackgroundTimer from 'react-native-background-timer';
import { connect } from 'react-redux';
@ -69,6 +69,7 @@ class JitsiMeetView extends React.Component<IJitsiMeetViewProps, IJitsiMeetViewS
}
}, 1000);
}
BackHandler.addEventListener('hardwareBackPress', this.endCall);
}
componentWillUnmount() {
@ -78,8 +79,16 @@ class JitsiMeetView extends React.Component<IJitsiMeetViewProps, IJitsiMeetViewS
this.jitsiTimeout = null;
BackgroundTimer.stopBackgroundTimer();
}
BackHandler.removeEventListener('hardwareBackPress', this.endCall);
if (isIOS) {
JitsiMeet.endCall();
}
}
endCall = () => {
JitsiMeet.endCall();
return null;
};
onConferenceWillJoin = () => {
this.setState({ loading: false });