refs #447 Fix account switching in global header menu
This commit is contained in:
parent
12b19f461b
commit
e4759b7fd1
|
@ -59,8 +59,7 @@ export default {
|
|||
return this.$router.push({ path: '/login' })
|
||||
},
|
||||
select (account) {
|
||||
console.log(account._id)
|
||||
return this.$router.push({ path: `/${account._id}/home` })
|
||||
return this.$store.dispatch('GlobalHeader/selectAccount', account)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -64,6 +64,12 @@ const GlobalHeader = {
|
|||
router.push(`/${account._id}/home`)
|
||||
})
|
||||
},
|
||||
selectAccount ({ state, commit }, account) {
|
||||
commit('updateChanging', true)
|
||||
const index = state.accounts.findIndex(a => a._id === account._id)
|
||||
commit('changeDefaultActive', index.toString())
|
||||
router.push({ path: `/${account._id}/home` })
|
||||
},
|
||||
async removeShortcutEvents () {
|
||||
ipcRenderer.removeAllListeners('change-account')
|
||||
return 'removeShortcutEvents'
|
||||
|
|
Loading…
Reference in New Issue