浏览代码

app: avoid loading config when going back to the welcome page

master
Saúl Ibarra Corretgé 6 年前
父节点
当前提交
a2f8e156da
共有 1 个文件被更改,包括 14 次插入7 次删除
  1. 14
    7
      react/features/app/actions.js

+ 14
- 7
react/features/app/actions.js 查看文件

@@ -81,16 +81,23 @@ export function appNavigate(uri: ?string) {
81 81
 
82 82
         let config;
83 83
 
84
-        try {
85
-            config = await loadConfig(url);
86
-            dispatch(storeConfig(baseURL, config));
87
-        } catch (error) {
84
+        // Avoid (re)loading the config when there is no room.
85
+        if (!room) {
88 86
             config = restoreConfig(baseURL);
87
+        }
88
+
89
+        if (!config) {
90
+            try {
91
+                config = await loadConfig(url);
92
+                dispatch(storeConfig(baseURL, config));
93
+            } catch (error) {
94
+                config = restoreConfig(baseURL);
89 95
 
90
-            if (!config) {
91
-                dispatch(loadConfigError(error, locationURL));
96
+                if (!config) {
97
+                    dispatch(loadConfigError(error, locationURL));
92 98
 
93
-                return;
99
+                    return;
100
+                }
94 101
             }
95 102
         }
96 103
 

正在加载...
取消
保存