Logging out progressbar

This commit is contained in:
Peter Papp
2021-02-06 14:18:53 +01:00
parent 9c92cffde3
commit e2a52d27f5
5 changed files with 25 additions and 14 deletions

View File

@@ -1,13 +1,13 @@
<template> <template>
<transition name="popup"> <transition name="popup">
<div class="popup" v-if="isZippingFiles"> <div class="popup" v-if="processingPopup">
<div class="popup-wrapper"> <div class="popup-wrapper">
<div class="popup-content"> <div class="popup-content">
<div class="spinner-wrapper"> <div class="spinner-wrapper">
<Spinner/> <Spinner/>
</div> </div>
<h1 class="title">{{ $t('popup_zipping.title') }}</h1> <h1 class="title">{{ processingPopup.title }}</h1>
<p class="message">{{ $t('popup_zipping.message') }}</p> <p class="message">{{ processingPopup.message }}</p>
</div> </div>
</div> </div>
</div> </div>
@@ -25,7 +25,7 @@ export default {
}, },
computed: { computed: {
...mapGetters([ ...mapGetters([
'isZippingFiles' 'processingPopup'
]) ])
} }
} }

View File

@@ -12,10 +12,10 @@
name: 'Vignette', name: 'Vignette',
computed: { computed: {
...mapGetters([ ...mapGetters([
'isZippingFiles' 'processingPopup'
]), ]),
isVisible() { isVisible() {
return this.isZippingFiles || this.isVisibleVignette return this.processingPopup || this.isVisibleVignette
}, },
}, },
data() { data() {

View File

@@ -6,13 +6,16 @@ import axios from 'axios'
import Vue from 'vue' import Vue from 'vue'
const defaultState = { const defaultState = {
isZippingFiles: false, processingPopup: undefined,
} }
const actions = { const actions = {
downloadFolder: ({commit, getters}, folder) => { downloadFolder: ({commit, getters}, folder) => {
commit('ZIPPING_FILE_STATUS', true) commit('PROCESSING_POPUP', {
title: i18n.t('popup_zipping.title'),
message: i18n.t('popup_zipping.message'),
})
// Get route // Get route
let route = getters.sharedDetail && !getters.sharedDetail.protected let route = getters.sharedDetail && !getters.sharedDetail.protected
@@ -27,7 +30,7 @@ const actions = {
Vue.prototype.$isSomethingWrong() Vue.prototype.$isSomethingWrong()
}) })
.finally(() => { .finally(() => {
commit('ZIPPING_FILE_STATUS', false) commit('PROCESSING_POPUP', undefined)
}) })
}, },
@@ -379,13 +382,13 @@ const actions = {
} }
const mutations = { const mutations = {
ZIPPING_FILE_STATUS(state, status) { PROCESSING_POPUP(state, status) {
state.isZippingFiles = status state.processingPopup = status
} }
} }
const getters = { const getters = {
isZippingFiles: state => state.isZippingFiles processingPopup: state => state.processingPopup
} }
export default { export default {

View File

@@ -39,11 +39,18 @@ const actions = {
}) })
}, },
logOut: ({getters, commit}) => { logOut: ({getters, commit}) => {
let popup = setTimeout(() => {
commit('PROCESSING_POPUP', {
title: 'Logging Out',
message: 'Wait a second...',
})
}, 300)
axios axios
.get(getters.api + '/logout') .get(getters.api + '/logout')
.then(() => { .then(() => {
clearTimeout(popup)
// Commit Remove Access Token from vuex storage
commit('DESTROY_DATA') commit('DESTROY_DATA')
router.push({name: 'SignIn'}) router.push({name: 'SignIn'})

View File

@@ -208,6 +208,7 @@
}, },
created() { created() {
this.$scrollTop() this.$scrollTop()
this.$store.commit('PROCESSING_POPUP', undefined)
} }
} }
</script> </script>