From 30049613c1cefaac77adaaf71f7a5b4350509fc2 Mon Sep 17 00:00:00 2001 From: Anthony Tseng Date: Thu, 15 Dec 2016 21:48:58 +0800 Subject: [PATCH] Fix immutable.getIn and autofillPopupHidden condition fix #6233 Auditors: @bridiver, @bbondy --- js/components/frame.js | 5 ++++- js/stores/windowStore.js | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/js/components/frame.js b/js/components/frame.js index 140b8b43425..5e72bee231f 100644 --- a/js/components/frame.js +++ b/js/components/frame.js @@ -688,7 +688,10 @@ class Frame extends ImmutableComponent { contextMenus.onShowAutofillMenu(e.suggestions, e.rect, this.frame) }) this.webview.addEventListener('hide-autofill-popup', (e) => { - windowActions.autofillPopupHidden(this.props.tabId) + let webContents = this.webview.getWebContents() + if (webContents && webContents.isFocused()) { + windowActions.autofillPopupHidden(this.props.tabId) + } }) this.webview.addEventListener('ipc-message', (e) => { let method = () => {} diff --git a/js/stores/windowStore.js b/js/stores/windowStore.js index c7aef98806c..b4e199e2364 100644 --- a/js/stores/windowStore.js +++ b/js/stores/windowStore.js @@ -658,8 +658,8 @@ const doAction = (action) => { case windowConstants.WINDOW_AUTOFILL_POPUP_HIDDEN: case windowConstants.WINDOW_SET_CONTEXT_MENU_DETAIL: if (!action.detail) { - if (windowState.getIn('contextMenuDetail', 'type') === 'autofill' && - windowState.getIn('contextMenuDetail', 'tabId') === action.tabId) { + if (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)