Skip to content
This repository has been archived by the owner on Jan 21, 2024. It is now read-only.

fix: routing loop entry after reinstallation #558

Merged
merged 1 commit into from
May 5, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/router/guard/permissionGuard.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ router.beforeEach(async (to, from, next) => {
await store.dispatch('fetchIsInstalled')
}

// if it is not installed, empty the dirty data
if (!store.getters.isInstalled) {
await store.commit('SET_OPTIONS', undefined)
await store.commit('CLEAR_TOKEN')
await store.commit('SET_USER', {})
}

if (!store.getters.isInstalled && to.name !== 'Install') {
next({
name: 'Install'
Expand Down