From 7289e59ca9730a509b26623c11723176298dd4eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Wed, 13 Feb 2019 16:41:33 +0100 Subject: [PATCH] audio-mode: don't change the mode unless there is no active conference If a new conference is joined and as a result the current one is terminated, don't ever attempt to set the audio mode. --- react/features/mobile/audio-mode/middleware.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/react/features/mobile/audio-mode/middleware.js b/react/features/mobile/audio-mode/middleware.js index 2550913ea..010c13e18 100644 --- a/react/features/mobile/audio-mode/middleware.js +++ b/react/features/mobile/audio-mode/middleware.js @@ -7,7 +7,8 @@ import { CONFERENCE_FAILED, CONFERENCE_LEFT, CONFERENCE_JOINED, - SET_AUDIO_ONLY + SET_AUDIO_ONLY, + getCurrentConference } from '../../base/conference'; import { MiddlewareRegistry } from '../../base/redux'; @@ -31,9 +32,15 @@ MiddlewareRegistry.register(({ getState }) => next => action => { switch (action.type) { case APP_WILL_MOUNT: case CONFERENCE_FAILED: - case CONFERENCE_LEFT: - mode = AudioMode.DEFAULT; + case CONFERENCE_LEFT: { + const conference = getCurrentConference(getState()); + + if (typeof conference === 'undefined') { + mode = AudioMode.DEFAULT; + } + break; + } /* * NOTE: We moved the audio mode setting from CONFERENCE_WILL_JOIN to