fix(rn,breakout-rooms) wait for the room to be left

Just like on web, we wait for the current room to be left in order to avoid all
kinds of problems.
This commit is contained in:
Saúl Ibarra Corretgé 2021-12-02 12:23:46 +01:00 committed by Saúl Ibarra Corretgé
parent 8ef48a8a1d
commit be53c4c522
1 changed files with 12 additions and 11 deletions

View File

@ -184,20 +184,21 @@ export function moveToRoom(roomId?: string) {
const { audio, video } = getState()['features/base/media'];
dispatch(conferenceWillLeave(conference));
conference.leave()
.catch(error => {
logger.warn(
'JitsiConference.leave() rejected with:',
error);
.catch(error => {
logger.warn('JitsiConference.leave() rejected with:', error);
dispatch(conferenceLeft(conference));
});
dispatch(clearNotifications());
dispatch(conferenceLeft(conference));
})
.then(() => {
dispatch(clearNotifications());
// dispatch(setRoom(_roomId));
dispatch(createConference(_roomId));
dispatch(setAudioMuted(audio.muted));
dispatch(setVideoMuted(video.muted));
// dispatch(setRoom(_roomId));
dispatch(createConference(_roomId));
dispatch(setAudioMuted(audio.muted));
dispatch(setVideoMuted(video.muted));
});
} else {
APP.conference.leaveRoom(false /* doDisconnect */)
.finally(() => APP.conference.joinRoom(_roomId));