mirror of
https://github.com/YunoHost/yunohost-admin.git
synced 2024-09-03 20:06:15 +02:00
migration(vuex): currentRoute is now a ref
This commit is contained in:
parent
2156196f8b
commit
6be1609f10
1 changed files with 5 additions and 4 deletions
|
@ -158,16 +158,17 @@ export default {
|
||||||
commit('SET_YUNOHOST_INFOS', null)
|
commit('SET_YUNOHOST_INFOS', null)
|
||||||
},
|
},
|
||||||
|
|
||||||
DISCONNECT({ dispatch }, route = router.currentRoute) {
|
DISCONNECT({ dispatch }, route) {
|
||||||
// FIXME vue3 currentRoute is now a ref (currentRoute.value)
|
// FIXME vue3 currentRoute is now a ref (currentRoute.value)
|
||||||
dispatch('RESET_CONNECTED')
|
dispatch('RESET_CONNECTED')
|
||||||
if (router.currentRoute.name === 'login') return
|
if (router.currentRoute.value.name === 'login') return
|
||||||
|
const previousRoute = route ?? router.currentRoute.value
|
||||||
router.push({
|
router.push({
|
||||||
name: 'login',
|
name: 'login',
|
||||||
// Add a redirect query if next route is not unknown (like `logout`) or `login`
|
// Add a redirect query if next route is not unknown (like `logout`) or `login`
|
||||||
query:
|
query:
|
||||||
route && !['login', null].includes(route.name)
|
previousRoute && !['login', null].includes(previousRoute.name)
|
||||||
? { redirect: route.path }
|
? { redirect: previousRoute.path }
|
||||||
: {},
|
: {},
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Reference in a new issue