Browse Source

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.
j8
Saúl Ibarra Corretgé 6 years ago
parent
commit
7289e59ca9
1 changed files with 10 additions and 3 deletions
  1. 10
    3
      react/features/mobile/audio-mode/middleware.js

+ 10
- 3
react/features/mobile/audio-mode/middleware.js View File

@@ -7,7 +7,8 @@ import {
7 7
     CONFERENCE_FAILED,
8 8
     CONFERENCE_LEFT,
9 9
     CONFERENCE_JOINED,
10
-    SET_AUDIO_ONLY
10
+    SET_AUDIO_ONLY,
11
+    getCurrentConference
11 12
 } from '../../base/conference';
12 13
 import { MiddlewareRegistry } from '../../base/redux';
13 14
 
@@ -31,9 +32,15 @@ MiddlewareRegistry.register(({ getState }) => next => action => {
31 32
         switch (action.type) {
32 33
         case APP_WILL_MOUNT:
33 34
         case CONFERENCE_FAILED:
34
-        case CONFERENCE_LEFT:
35
-            mode = AudioMode.DEFAULT;
35
+        case CONFERENCE_LEFT: {
36
+            const conference = getCurrentConference(getState());
37
+
38
+            if (typeof conference === 'undefined') {
39
+                mode = AudioMode.DEFAULT;
40
+            }
41
+
36 42
             break;
43
+        }
37 44
 
38 45
         /*
39 46
          * NOTE: We moved the audio mode setting from CONFERENCE_WILL_JOIN to

Loading…
Cancel
Save