1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 01:47:00 +01:00

Merge pull request #4592 from vittominacori/fix/close-popup-bug-#4553

set an id to the metamask notification popup
This commit is contained in:
Thomas Huang 2018-06-20 15:50:07 -07:00 committed by GitHub
commit 46b2f1df11
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -32,6 +32,8 @@ class NotificationManager {
type: 'popup',
width,
height,
}).then((currentPopup) => {
this._popupId = currentPopup.id
})
}
})
@ -84,7 +86,7 @@ class NotificationManager {
}
/**
* Given an array of windows, returns the first that has a 'popup' type, or null if no such window exists.
* Given an array of windows, returns the 'popup' that has been opened by MetaMask, or null if no such window exists.
*
* @private
* @param {array} windows An array of objects containing data about the open MetaMask extension windows.
@ -93,7 +95,7 @@ class NotificationManager {
_getPopupIn (windows) {
return windows ? windows.find((win) => {
// Returns notification popup
return (win && win.type === 'popup')
return (win && win.type === 'popup' && win.id === this._popupId)
}) : null
}