Prevent closing and allow server selection from login required modal,

This commit is contained in:
James Lyne 2021-09-01 01:02:32 +01:00
parent 21cb8da32f
commit 8a7a05c0d1
4 changed files with 12 additions and 5 deletions

View File

@ -266,7 +266,7 @@
bottom: 0;
right: 0;
transition: 0.3s opacity linear;
z-index: 10000;
z-index: 100;
background-color: var(--background-dark);
cursor: wait;
display: flex;

View File

@ -17,7 +17,7 @@
<template>
<Map></Map>
<ChatBox v-if="chatBoxEnabled" v-show="chatBoxEnabled && chatVisible"></ChatBox>
<LoginModal v-if="loginEnabled"></LoginModal>
<LoginModal v-if="loginEnabled" :required="loginRequired"></LoginModal>
<Sidebar></Sidebar>
<notifications position="bottom center" :speed="250" :max="3" :ignoreDuplicates="true" classes="notification" />
</template>
@ -54,9 +54,11 @@ export default defineComponent({
currentServer = computed(() => store.state.currentServer),
configurationHash = computed(() => store.state.configurationHash),
chatBoxEnabled = computed(() => store.state.components.chatBox),
loginEnabled = computed(() => store.state.components.login),
chatVisible = computed(() => store.state.ui.visibleElements.has('chat')),
loginEnabled = computed(() => store.state.components.login),
loggedIn = computed(() => store.state.loggedIn),
loginRequired = ref(false),
loading = ref(false),
loadingAttempts = ref(0),
@ -72,6 +74,8 @@ export default defineComponent({
await store.dispatch(ActionTypes.LOAD_CONFIGURATION, undefined);
await store.dispatch(ActionTypes.START_UPDATES, undefined);
loginRequired.value = false;
requestAnimationFrame(() => {
hideSplash();
@ -89,7 +93,7 @@ export default defineComponent({
//Show login screen if required
if(e.message === 'login-required') {
hideSplash();
loginRequired.value = true;
store.commit(MutationTypes.SHOW_UI_MODAL, 'login');
notify('Login required');
return;
@ -212,6 +216,7 @@ export default defineComponent({
chatBoxEnabled,
chatVisible,
loginEnabled,
loginRequired,
}
},
});

View File

@ -152,7 +152,7 @@ export default defineComponent({
.sidebar {
position: fixed;
z-index: 120;
z-index: 110;
top: 0;
right: 0;
bottom: 0;

View File

@ -45,6 +45,7 @@ export type State = {
components: LiveAtlasComponentConfig;
loggedIn: boolean;
loginRequired: boolean;
worlds: Map<string, LiveAtlasWorldDefinition>;
maps: Map<string, LiveAtlasMapDefinition>;
@ -170,6 +171,7 @@ export const state: State = {
},
loggedIn: false,
loginRequired: false,
worlds: new Map(), //Defined (loaded) worlds with maps from configuration.json
maps: new Map(), //Defined maps from configuration.json