소스 검색

[RN] Load config.js only when the room is known

This patch loads the config later than we used to, that is, only once we
know the room the user is about to join.

Due to architectural limitations in lib-jitsi-meet, it needs to be
initialized with a configuration in order to properly function. This is
unfortunate because we need to create a video track in the welcome page,
but don't know the room (hence no config) yet. In order to circumvent
this problem an empty configuration is used, which is later swapped with
the appropriate one, once loaded.

Some interesting side-effects of this change are a perceived speed
increase when the app starts or a conference is hangup. They are both
due to the fact that no config needs to be fetched from a remote server
in those cases.
j8
Saúl Ibarra Corretgé 8 년 전
부모
커밋
18d1572dab
2개의 변경된 파일9개의 추가작업 그리고 1개의 파일을 삭제
  1. 8
    0
      react/features/app/actions.js
  2. 1
    1
      react/features/base/config/actions.js

+ 8
- 0
react/features/app/actions.js 파일 보기

168
  * @returns {Promise<Object>}
168
  * @returns {Promise<Object>}
169
  */
169
  */
170
 function _loadConfig({ contextRoot, host, protocol, room }) {
170
 function _loadConfig({ contextRoot, host, protocol, room }) {
171
+    // XXX As the mobile/React Native app does not employ config on the
172
+    // WelcomePage, do not download config.js from the deployment when
173
+    // navigating to the WelcomePage - the perceived/visible navigation will be
174
+    // faster.
175
+    if (!room && typeof APP === 'undefined') {
176
+        return Promise.resolve();
177
+    }
178
+
171
     /* eslint-disable no-param-reassign */
179
     /* eslint-disable no-param-reassign */
172
 
180
 
173
     protocol = protocol.toLowerCase();
181
     protocol = protocol.toLowerCase();

+ 1
- 1
react/features/base/config/actions.js 파일 보기

14
  *     config: Object
14
  *     config: Object
15
  * }}
15
  * }}
16
  */
16
  */
17
-export function setConfig(config: Object) {
17
+export function setConfig(config: Object = {}) {
18
     return {
18
     return {
19
         type: SET_CONFIG,
19
         type: SET_CONFIG,
20
         config
20
         config

Loading…
취소
저장