Selaa lähdekoodia

settings: fix loading disableCallIntegration

master
Saúl Ibarra Corretgé 6 vuotta sitten
vanhempi
commit
3cd7f0b77d
1 muutettua tiedostoa jossa 21 lisäystä ja 1 poistoa
  1. 21
    1
      react/features/base/settings/middleware.js

+ 21
- 1
react/features/base/settings/middleware.js Näytä tiedosto

1
 // @flow
1
 // @flow
2
 
2
 
3
+import { APP_WILL_MOUNT } from '../app';
3
 import { setAudioOnly } from '../audio-only';
4
 import { setAudioOnly } from '../audio-only';
4
 import { getLocalParticipant, participantUpdated } from '../participants';
5
 import { getLocalParticipant, participantUpdated } from '../participants';
5
 import { MiddlewareRegistry } from '../redux';
6
 import { MiddlewareRegistry } from '../redux';
19
     const result = next(action);
20
     const result = next(action);
20
 
21
 
21
     switch (action.type) {
22
     switch (action.type) {
23
+    case APP_WILL_MOUNT:
24
+        _initializeCallIntegration(store);
25
+        break;
22
     case SETTINGS_UPDATED:
26
     case SETTINGS_UPDATED:
23
         _maybeHandleCallIntegrationChange(action);
27
         _maybeHandleCallIntegrationChange(action);
24
         _maybeSetAudioOnly(store, action);
28
         _maybeSetAudioOnly(store, action);
25
         _updateLocalParticipant(store, action);
29
         _updateLocalParticipant(store, action);
30
+        break;
26
     }
31
     }
27
 
32
 
28
     return result;
33
     return result;
29
 });
34
 });
30
 
35
 
36
+/**
37
+ * Initializes the audio device handler based on the `disableCallIntegration` setting.
38
+ *
39
+ * @param {Store} store - The redux store.
40
+ * @private
41
+ * @returns {void}
42
+ */
43
+function _initializeCallIntegration({ getState }) {
44
+    const { disableCallIntegration } = getState()['features/base/settings'];
45
+
46
+    if (typeof disableCallIntegration === 'boolean') {
47
+        handleCallIntegrationChange(disableCallIntegration);
48
+    }
49
+}
50
+
31
 /**
51
 /**
32
  * Maps the settings field names to participant names where they don't match.
52
  * Maps the settings field names to participant names where they don't match.
33
  * Currently there is only one such field, but may be extended in the future.
53
  * Currently there is only one such field, but may be extended in the future.
46
 }
66
 }
47
 
67
 
48
 /**
68
 /**
49
- * Updates {@code startAudioOnly} flag if it's updated in the settings.
69
+ * Handles a change in the `disableCallIntegration` setting.
50
  *
70
  *
51
  * @param {Object} action - The redux action.
71
  * @param {Object} action - The redux action.
52
  * @private
72
  * @private

Loading…
Peruuta
Tallenna