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

Fix immutable.getIn and autofillPopupHidden condition #6234

Merged
merged 1 commit into from
Dec 15, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion js/components/frame.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this shouldn't be necessary anymore. I changed windowStore to make a check instead. I think we may want to revert this unless I'm missing something

if (webContents && webContents.isFocused()) {
windowActions.autofillPopupHidden(this.props.tabId)
}
})
this.webview.addEventListener('ipc-message', (e) => {
let method = () => {}
Expand Down
4 changes: 2 additions & 2 deletions js/stores/windowStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

woops, it'd be nice to lint for this type of error eventually.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is probably the reason the code above was still needed. I think we can keep this and lose the isFocused check

windowState = windowState.delete('contextMenuDetail')
if (action.notify) {
ipc.send('autofill-popup-hidden', action.tabId)
Expand Down