mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Conditionally use Promise-based extension API when creating windows
This commit is contained in:
parent
1f0cf11af1
commit
badf0ce314
@ -26,15 +26,15 @@ class NotificationManager {
|
||||
// bring focus to existing chrome popup
|
||||
extension.windows.update(popup.id, { focused: true })
|
||||
} else {
|
||||
const cb = (currentPopup) => { this._popupId = currentPopup.id }
|
||||
// create new notification popup
|
||||
extension.windows.create({
|
||||
const creation = extension.windows.create({
|
||||
url: 'notification.html',
|
||||
type: 'popup',
|
||||
width,
|
||||
height,
|
||||
}).then((currentPopup) => {
|
||||
this._popupId = currentPopup.id
|
||||
})
|
||||
}, cb)
|
||||
creation && creation.then && creation.then(cb)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user