From bf05f38b9c4139044bb7c2689fe64a52844e0fa5 Mon Sep 17 00:00:00 2001 From: AkiraFukushima Date: Sat, 3 Nov 2018 14:10:22 +0900 Subject: [PATCH] refs #691 Block changing account when the modal is active --- src/renderer/store/GlobalHeader.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/renderer/store/GlobalHeader.js b/src/renderer/store/GlobalHeader.js index 28cfe6de..14745e9a 100644 --- a/src/renderer/store/GlobalHeader.js +++ b/src/renderer/store/GlobalHeader.js @@ -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`)