Merge pull request #692 from h3poteto/iss-691

closes #691 Block changing account when the modal is active
This commit is contained in:
AkiraFukushima 2018-11-03 16:23:53 +09:00 committed by GitHub
commit ea8b6f87b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -50,7 +50,7 @@ const GlobalHeader = {
})
})
},
watchShortcutEvents ({ state, commit, rootState }) {
watchShortcutEvents ({ state, commit, rootState, rootGetters }) {
ipcRenderer.on('change-account', (event, account) => {
if (state.changing) {
return null
@ -58,6 +58,10 @@ const GlobalHeader = {
if (rootState.route.params.id === account._id) {
return null
}
// When the modal window is active, don't change account
if (rootGetters['TimelineSpace/Modals/modalOpened']) {
return null
}
// changing finish after loading
commit('updateChanging', true)
router.push(`/${account._id}/home`)