From 6be1609f1057d23896aeb18159286d278b6b423e Mon Sep 17 00:00:00 2001 From: axolotle Date: Mon, 18 Mar 2024 16:46:23 +0100 Subject: [PATCH] migration(vuex): currentRoute is now a ref --- app/src/store/info.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/src/store/info.js b/app/src/store/info.js index a631b37d..88aa1f38 100644 --- a/app/src/store/info.js +++ b/app/src/store/info.js @@ -158,16 +158,17 @@ export default { commit('SET_YUNOHOST_INFOS', null) }, - DISCONNECT({ dispatch }, route = router.currentRoute) { + DISCONNECT({ dispatch }, route) { // FIXME vue3 currentRoute is now a ref (currentRoute.value) dispatch('RESET_CONNECTED') - if (router.currentRoute.name === 'login') return + if (router.currentRoute.value.name === 'login') return + const previousRoute = route ?? router.currentRoute.value router.push({ name: 'login', // Add a redirect query if next route is not unknown (like `logout`) or `login` query: - route && !['login', null].includes(route.name) - ? { redirect: route.path } + previousRoute && !['login', null].includes(previousRoute.name) + ? { redirect: previousRoute.path } : {}, }) },