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:
commit
46b2f1df11
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user