Bläddra i källkod

settings: fix loading disableCallIntegration

master
Saúl Ibarra Corretgé 6 år sedan
förälder
incheckning
3cd7f0b77d
1 ändrade filer med 21 tillägg och 1 borttagningar
  1. 21
    1
      react/features/base/settings/middleware.js

+ 21
- 1
react/features/base/settings/middleware.js Visa fil

@@ -1,5 +1,6 @@
1 1
 // @flow
2 2
 
3
+import { APP_WILL_MOUNT } from '../app';
3 4
 import { setAudioOnly } from '../audio-only';
4 5
 import { getLocalParticipant, participantUpdated } from '../participants';
5 6
 import { MiddlewareRegistry } from '../redux';
@@ -19,15 +20,34 @@ MiddlewareRegistry.register(store => next => action => {
19 20
     const result = next(action);
20 21
 
21 22
     switch (action.type) {
23
+    case APP_WILL_MOUNT:
24
+        _initializeCallIntegration(store);
25
+        break;
22 26
     case SETTINGS_UPDATED:
23 27
         _maybeHandleCallIntegrationChange(action);
24 28
         _maybeSetAudioOnly(store, action);
25 29
         _updateLocalParticipant(store, action);
30
+        break;
26 31
     }
27 32
 
28 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 52
  * Maps the settings field names to participant names where they don't match.
33 53
  * Currently there is only one such field, but may be extended in the future.
@@ -46,7 +66,7 @@ function _mapSettingsFieldToParticipant(settingsField) {
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 71
  * @param {Object} action - The redux action.
52 72
  * @private

Laddar…
Avbryt
Spara