diff --git a/src/App.vue b/src/App.vue index 6414a8a..1191d27 100644 --- a/src/App.vue +++ b/src/App.vue @@ -29,6 +29,7 @@ import {useStore} from "@/store"; import {ActionTypes} from "@/store/action-types"; import {parseUrl} from '@/util'; import {MutationTypes} from "@/store/mutation-types"; +import {LiveAtlasServerDefinition} from "@/index"; export default defineComponent({ name: 'App', @@ -62,7 +63,7 @@ export default defineComponent({ return; } - const error = `Failed to load server configuration for '${store.state.currentServer}'`; + const error = `Failed to load server configuration for '${store.state.currentServer.id}'`; console.error(`${error}:`, e); window.showSplashError(`${error}\n${e}`, false, ++configAttempts.value); setTimeout(() => loadConfiguration(), 1000); @@ -125,16 +126,20 @@ export default defineComponent({ watch(title, (title) => document.title = title); watch(currentUrl, (url) => window.history.replaceState({}, '', url)); - watch(currentServer, (newServer) => { + watch(currentServer, (newServer: LiveAtlasServerDefinition) => { window.showSplash(); stopUpdates(); + if(!newServer) { + return; + } + //Cleanup store.commit(MutationTypes.CLEAR_PLAYERS, undefined); store.commit(MutationTypes.CLEAR_CURRENT_MAP, undefined); store.commit(MutationTypes.CLEAR_PARSED_URL, undefined); - window.history.replaceState({}, '', newServer); + window.history.replaceState({}, '', newServer.id); loadConfiguration(); }); watch(configurationHash, (newHash, oldHash) => { diff --git a/src/components/sidebar/ServerListItem.vue b/src/components/sidebar/ServerListItem.vue index 1388a13..d2a192d 100644 --- a/src/components/sidebar/ServerListItem.vue +++ b/src/components/sidebar/ServerListItem.vue @@ -15,8 +15,8 @@ -->