Merge pull request #4717 from MetaMask/chrome-promise-bugfix

Conditionally use Promise-based extension API when creating windows
feature/default_network_editable
Dan Finlay 6 years ago committed by GitHub
commit 2e9bd7e9d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      app/scripts/lib/notification-manager.js

@ -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…
Cancel
Save