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

This commit is contained in:
Saúl Ibarra Corretgé
2019-05-23 15:16:31 +02:00
committed by Saúl Ibarra Corretgé
parent a4cf79c161
commit a2f8e156da
+14 -7
View File
@@ -81,16 +81,23 @@ export function appNavigate(uri: ?string) {
let config;
try {
config = await loadConfig(url);
dispatch(storeConfig(baseURL, config));
} catch (error) {
// Avoid (re)loading the config when there is no room.
if (!room) {
config = restoreConfig(baseURL);
}
if (!config) {
dispatch(loadConfigError(error, locationURL));
if (!config) {
try {
config = await loadConfig(url);
dispatch(storeConfig(baseURL, config));
} catch (error) {
config = restoreConfig(baseURL);
return;
if (!config) {
dispatch(loadConfigError(error, locationURL));
return;
}
}
}