瀏覽代碼

[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.
master
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,6 +168,14 @@ export function appWillUnmount(app) {
168 168
  * @returns {Promise<Object>}
169 169
  */
170 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 179
     /* eslint-disable no-param-reassign */
172 180
 
173 181
     protocol = protocol.toLowerCase();

+ 1
- 1
react/features/base/config/actions.js 查看文件

@@ -14,7 +14,7 @@ import { SET_CONFIG } from './actionTypes';
14 14
  *     config: Object
15 15
  * }}
16 16
  */
17
-export function setConfig(config: Object) {
17
+export function setConfig(config: Object = {}) {
18 18
     return {
19 19
         type: SET_CONFIG,
20 20
         config

Loading…
取消
儲存