More async/await. Improve error display
This commit is contained in:
parent
2f8c4a9ab3
commit
87024079cc
14
src/App.vue
14
src/App.vue
@ -51,15 +51,17 @@ export default defineComponent({
|
|||||||
updateTimeout = ref(0),
|
updateTimeout = ref(0),
|
||||||
configAttempts = ref(0),
|
configAttempts = ref(0),
|
||||||
|
|
||||||
loadConfiguration = () => {
|
loadConfiguration = async () => {
|
||||||
return store.dispatch(ActionTypes.LOAD_CONFIGURATION, undefined).then(() => {
|
try {
|
||||||
|
await store.dispatch(ActionTypes.LOAD_CONFIGURATION, undefined);
|
||||||
startUpdates();
|
startUpdates();
|
||||||
requestAnimationFrame(() => window.hideSplash());
|
requestAnimationFrame(() => window.hideSplash());
|
||||||
}).catch(e => {
|
} catch(e) {
|
||||||
console.error('Failed to load server configuration: ', e);
|
const error = `Failed to load server configuration for '${store.state.currentServer}'`;
|
||||||
window.showSplashError('Failed to load server configuration\n' + e, false, ++configAttempts.value);
|
console.error(`${error}:`, e);
|
||||||
|
window.showSplashError(`${error}\n${e}`, false, ++configAttempts.value);
|
||||||
setTimeout(() => loadConfiguration(), 1000);
|
setTimeout(() => loadConfiguration(), 1000);
|
||||||
});
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
startUpdates = () => {
|
startUpdates = () => {
|
||||||
|
Loading…
Reference in New Issue
Block a user