fix: routing loop entry after reinstallation (#558)

Signed-off-by: Ryan Wang <i@ryanc.cc>
pull/561/head
Ryan Wang 3 years ago committed by GitHub
parent a765ad0ab4
commit d5f1f6ce6d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -20,6 +20,13 @@ router.beforeEach(async (to, from, next) => {
await store.dispatch('fetchIsInstalled') 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') { if (!store.getters.isInstalled && to.name !== 'Install') {
next({ next({
name: 'Install' name: 'Install'

Loading…
Cancel
Save