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; bottom: 0;
right: 0; right: 0;
transition: 0.3s opacity linear; transition: 0.3s opacity linear;
z-index: 10000; z-index: 100;
background-color: var(--background-dark); background-color: var(--background-dark);
cursor: wait; cursor: wait;
display: flex; display: flex;

View File

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

View File

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

View File

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