app: avoid loading config when going back to the welcome page
This commit is contained in:
parent
a4cf79c161
commit
a2f8e156da
|
@ -81,16 +81,23 @@ export function appNavigate(uri: ?string) {
|
||||||
|
|
||||||
let config;
|
let config;
|
||||||
|
|
||||||
try {
|
// Avoid (re)loading the config when there is no room.
|
||||||
config = await loadConfig(url);
|
if (!room) {
|
||||||
dispatch(storeConfig(baseURL, config));
|
|
||||||
} catch (error) {
|
|
||||||
config = restoreConfig(baseURL);
|
config = restoreConfig(baseURL);
|
||||||
|
}
|
||||||
|
|
||||||
if (!config) {
|
if (!config) {
|
||||||
dispatch(loadConfigError(error, locationURL));
|
try {
|
||||||
|
config = await loadConfig(url);
|
||||||
|
dispatch(storeConfig(baseURL, config));
|
||||||
|
} catch (error) {
|
||||||
|
config = restoreConfig(baseURL);
|
||||||
|
|
||||||
return;
|
if (!config) {
|
||||||
|
dispatch(loadConfigError(error, locationURL));
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue