Przeglądaj źródła

[RN] Enforce mandatory mobile app-specific config

j8
Lyubomir Marinov 8 lat temu
rodzic
commit
9ac7c97e67
1 zmienionych plików z 15 dodań i 5 usunięć
  1. 15
    5
      react/features/base/lib-jitsi-meet/reducer.js

+ 15
- 5
react/features/base/lib-jitsi-meet/reducer.js Wyświetl plik

@@ -8,7 +8,7 @@ import {
8 8
 } from './actionTypes';
9 9
 
10 10
 /**
11
- * Initial state of 'features/base/lib-jitsi-meet'.
11
+ * The initial state of 'features/base/lib-jitsi-meet'.
12 12
  *
13 13
  * @type {{
14 14
  *     initializationError: null,
@@ -16,6 +16,14 @@ import {
16 16
  * }}
17 17
  */
18 18
 const INITIAL_STATE = {
19
+    /**
20
+     * The mandatory configuration to be passed to JitsiMeetJS#init(). The app
21
+     * will download config.js from the Jitsi Meet deployment and taks its
22
+     * values into account but the values bellow will be enforced (because they
23
+     * are essential to the correct execution of the application).
24
+     *
25
+     * @type {Object}
26
+     */
19 27
     config: {
20 28
         // FIXME The support for audio levels in lib-jitsi-meet polls the
21 29
         // statistics of WebRTC at a short interval multiple times a second.
@@ -80,10 +88,12 @@ function _setConfig(state, action) {
80 88
     return {
81 89
         ...state,
82 90
         config: {
83
-            // The final config is the result of augmenting the default config
84
-            // with whatever the deployment has chosen to override/overwrite.
85
-            ...INITIAL_STATE.config,
86
-            ...action.config
91
+            ...action.config,
92
+
93
+            // The config of INITIAL_STATE is meant to override the config
94
+            // downloaded from the Jitsi Meet deployment because the former
95
+            // contains values that are mandatory.
96
+            ...INITIAL_STATE.config
87 97
         }
88 98
     };
89 99
 }

Ładowanie…
Anuluj
Zapisz