瀏覽代碼

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
 
81
 
82
         let config;
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
             config = restoreConfig(baseURL);
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
 

Loading…
取消
儲存