Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Commit

Permalink
Check tab id before clearing context detail
Browse files Browse the repository at this point in the history
follow-up of brave/muon#170 (comment)

Auditors: @bridiver, @bbondy

Test Plan: Covered by automatic test
  • Loading branch information
darkdh committed Mar 25, 2017
1 parent b3febec commit 396cdbc
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions js/stores/windowStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,15 @@ const doAction = (action) => {
windowState = windowState.delete('contextMenuDetail')
break
case windowConstants.WINDOW_AUTOFILL_POPUP_HIDDEN:
if (!action.detail &&
windowState.getIn(['contextMenuDetail', 'type']) === 'autofill' &&
windowState.getIn(['contextMenuDetail', 'tabId']) === action.tabId) {
windowState = windowState.delete('contextMenuDetail')
if (action.notify) {
ipc.send('autofill-popup-hidden', action.tabId)
}
}
break
case windowConstants.WINDOW_SET_CONTEXT_MENU_DETAIL:
if (!action.detail) {
if (windowState.getIn(['contextMenuDetail', 'type']) === 'hamburgerMenu') {
Expand All @@ -510,13 +519,6 @@ const doAction = (action) => {
windowState = windowState.set('hamburgerMenuWasOpen', false)
}
windowState = windowState.delete('contextMenuDetail')

if (windowState.getIn(['contextMenuDetail', 'type']) === 'autofill' &&
windowState.getIn(['contextMenuDetail', 'tabId']) === action.tabId) {
if (action.notify) {
ipc.send('autofill-popup-hidden', action.tabId)
}
}
} else {
if (!(action.detail.get('type') === 'hamburgerMenu' && windowState.get('hamburgerMenuWasOpen'))) {
windowState = windowState.set('contextMenuDetail', action.detail)
Expand Down

0 comments on commit 396cdbc

Please sign in to comment.