remove store way

This commit is contained in:
ogerly 2023-02-09 16:19:21 +01:00
parent 56e3e7c5de
commit af47bf847b
3 changed files with 2 additions and 13 deletions

View File

@ -67,7 +67,7 @@ export default {
} }
if (this.tokenExpiresInSeconds === 0) { if (this.tokenExpiresInSeconds === 0) {
this.$timer.stop('tokenExpires') this.$timer.stop('tokenExpires')
this.$store.commit('automaticallyLoggedOut', true) this.toastInfoNoHide('Du wurdest automatisch abgemeldet')
this.$emit('logout') this.$emit('logout')
} }
}, },
@ -85,7 +85,7 @@ export default {
}) })
.catch(() => { .catch(() => {
this.$timer.stop('tokenExpires') this.$timer.stop('tokenExpires')
this.$store.commit('automaticallyLoggedOut', true) this.toastInfoNoHide('Du wurdest automatisch abgemeldet')
this.$emit('logout') this.$emit('logout')
}) })
}, },

View File

@ -123,11 +123,5 @@ export default {
return !this.showPageMessage return !this.showPageMessage
}, },
}, },
mounted() {
if (this.$store.state.automaticallyLoggedOut) {
this.toastInfoNoHide('Du wurdest automatisch abgemeldet')
this.$store.commit('automaticallyLoggedOut', false)
}
},
} }
</script> </script>

View File

@ -53,9 +53,6 @@ export const mutations = {
hideAmountGDT: (state, hideAmountGDT) => { hideAmountGDT: (state, hideAmountGDT) => {
state.hideAmountGDT = !!hideAmountGDT state.hideAmountGDT = !!hideAmountGDT
}, },
automaticallyLoggedOut: (state, automaticallyLoggedOut) => {
state.automaticallyLoggedOut = !!automaticallyLoggedOut
},
} }
export const actions = { export const actions = {
@ -71,7 +68,6 @@ export const actions = {
commit('isAdmin', data.isAdmin) commit('isAdmin', data.isAdmin)
commit('hideAmountGDD', data.hideAmountGDD) commit('hideAmountGDD', data.hideAmountGDD)
commit('hideAmountGDT', data.hideAmountGDT) commit('hideAmountGDT', data.hideAmountGDT)
commit('automaticallyLoggedOut', false)
}, },
logout: ({ commit, state }) => { logout: ({ commit, state }) => {
commit('token', null) commit('token', null)
@ -112,7 +108,6 @@ try {
publisherId: null, publisherId: null,
hideAmountGDD: null, hideAmountGDD: null,
hideAmountGDT: null, hideAmountGDT: null,
automaticallyLoggedOut: false,
}, },
getters: {}, getters: {},
// Syncronous mutation of the state // Syncronous mutation of the state