Browse Source

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

master
Saúl Ibarra Corretgé 6 years ago
parent
commit
a2f8e156da
1 changed files with 14 additions and 7 deletions
  1. 14
    7
      react/features/app/actions.js

+ 14
- 7
react/features/app/actions.js View File

@@ -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
 

Loading…
Cancel
Save