From 0d3b0b5db661c45912529e26d6c24f40ed94afe1 Mon Sep 17 00:00:00 2001 From: James Lyne Date: Wed, 16 Dec 2020 22:40:44 +0000 Subject: [PATCH] Server config error handling --- public/index.html | 98 +++++++++++++++++++-------- src/App.vue | 6 ++ src/components/map/layer/MapLayer.vue | 11 +-- src/dynmap.d.ts | 1 + src/main.ts | 31 ++++++++- 5 files changed, 112 insertions(+), 35 deletions(-) diff --git a/public/index.html b/public/index.html index 658a012..8d2052b 100644 --- a/public/index.html +++ b/public/index.html @@ -23,6 +23,16 @@ Minecraft Dynamic Map -
- - + + + + + + + + + + + + + +
+
- diff --git a/src/App.vue b/src/App.vue index f81e5e8..f386eaf 100644 --- a/src/App.vue +++ b/src/App.vue @@ -43,11 +43,17 @@ export default defineComponent({ currentUrl = computed(() => store.getters.url), updatesEnabled = ref(false), updateTimeout = ref(0), + configAttempts = ref(0), loadConfiguration = () => { store.dispatch(ActionTypes.LOAD_CONFIGURATION, undefined).then(() => { startUpdates(); window.hideSplash(); + }).catch(e => { + console.error('Failed to load server configuration: ', e); + window.showSplashError(++configAttempts.value); + + setTimeout(() => loadConfiguration(), 1000); }); }, diff --git a/src/components/map/layer/MapLayer.vue b/src/components/map/layer/MapLayer.vue index e18cd74..23d220f 100644 --- a/src/components/map/layer/MapLayer.vue +++ b/src/components/map/layer/MapLayer.vue @@ -15,7 +15,7 @@ -->