소스 검색

[RN] Enforce mandatory mobile app-specific config

j8
Lyubomir Marinov 8 년 전
부모
커밋
9ac7c97e67
1개의 변경된 파일15개의 추가작업 그리고 5개의 파일을 삭제
  1. 15
    5
      react/features/base/lib-jitsi-meet/reducer.js

+ 15
- 5
react/features/base/lib-jitsi-meet/reducer.js 파일 보기

8
 } from './actionTypes';
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
  * @type {{
13
  * @type {{
14
  *     initializationError: null,
14
  *     initializationError: null,
16
  * }}
16
  * }}
17
  */
17
  */
18
 const INITIAL_STATE = {
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
     config: {
27
     config: {
20
         // FIXME The support for audio levels in lib-jitsi-meet polls the
28
         // FIXME The support for audio levels in lib-jitsi-meet polls the
21
         // statistics of WebRTC at a short interval multiple times a second.
29
         // statistics of WebRTC at a short interval multiple times a second.
80
     return {
88
     return {
81
         ...state,
89
         ...state,
82
         config: {
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
 }

Loading…
취소
저장