mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +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',
|
type: 'popup',
|
||||||
width,
|
width,
|
||||||
height,
|
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
|
* @private
|
||||||
* @param {array} windows An array of objects containing data about the open MetaMask extension windows.
|
* @param {array} windows An array of objects containing data about the open MetaMask extension windows.
|
||||||
@ -93,7 +95,7 @@ class NotificationManager {
|
|||||||
_getPopupIn (windows) {
|
_getPopupIn (windows) {
|
||||||
return windows ? windows.find((win) => {
|
return windows ? windows.find((win) => {
|
||||||
// Returns notification popup
|
// Returns notification popup
|
||||||
return (win && win.type === 'popup')
|
return (win && win.type === 'popup' && win.id === this._popupId)
|
||||||
}) : null
|
}) : null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user