reload on login for compatibility with autologout

This commit is contained in:
2021-09-02 15:09:35 +02:00
parent bc16158162
commit a535a2e3cf
9 changed files with 38 additions and 50 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -32,3 +32,4 @@ global-js:
# - url_to_video_filter/player_embed
# - url_to_video_filter/vimeo_embed
# - url_to_video_filter/youtube_embed

View File

@@ -9,7 +9,7 @@ export default {
const img = figure.querySelector('img:not(.blank)')
figure.classList.add('loading')
img.addEventListener('load', function (e) {
console.log('img loaded', e)
// console.log('img loaded', e)
figure.classList.remove('loading')
figure.classList.add('loaded')
})
@@ -57,14 +57,14 @@ export default {
},
mounted () {
// lazy load images on mouseover
console.log('card mounted', this.$options.name)
// console.log('card mounted', this.$options.name)
// if (this.$options.name ==! 'ModalCard') {
this.activateLazyLoad()
// }
},
updated () {
// lazy load images on mouseover
console.log('card updated', this.$options.name)
// console.log('card updated', this.$options.name)
// if (this.$options.name ==! 'ModalCard') {
this.activateLazyLoad()
// }
@@ -72,7 +72,7 @@ export default {
methods: {
// used by ModalCard
activateLazyLoad () {
console.log('card activateLazyLoad', this.$options.name)
// console.log('card activateLazyLoad', this.$options.name)
this.$el.addEventListener('mouseover', function (event) {
const figures = this.querySelectorAll('.images figure.lazy:not(.loaded):not(.loading)')

View File

@@ -180,15 +180,19 @@ export default {
commit('setToken', response.data)
dispatch('getUser').then(userdata => {
console.log('User Loggedin', state.isAdmin, state.isAdherent)
if (state.isAdmin) {
window.location.reload(true)
}
// have to reload systematicly because of autologout library not loaded if not logged in the begining
// if (state.isAdmin) {
// window.location.reload()
// }
if (state.isAdherent) {
router.push({
name: 'base'
})
// TODO: openCloseHamMenu(false)
dispatch('Common/openCloseHamMenu', false)
// router.push({
// name: 'base'
// })
// // TODO: openCloseHamMenu(false)
// dispatch('Common/openCloseHamMenu', false)
window.location = '/base'
} else {
window.location.reload()
}
resolve()
})