aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Finlay <542863+danfinlay@users.noreply.github.com>2018-07-04 02:16:35 +0800
committerGitHub <noreply@github.com>2018-07-04 02:16:35 +0800
commit2e9bd7e9d101287b4466475561df9131f0ef56a6 (patch)
tree0cac0f745117a50dcceb7448cf79965747e46c66
parent8def5281b43c2ce2abc272bc3fbef6dc83a41327 (diff)
parentbadf0ce3142b97631dc2ba559a68005258625026 (diff)
downloadtangerine-wallet-browser-2e9bd7e9d101287b4466475561df9131f0ef56a6.tar
tangerine-wallet-browser-2e9bd7e9d101287b4466475561df9131f0ef56a6.tar.gz
tangerine-wallet-browser-2e9bd7e9d101287b4466475561df9131f0ef56a6.tar.bz2
tangerine-wallet-browser-2e9bd7e9d101287b4466475561df9131f0ef56a6.tar.lz
tangerine-wallet-browser-2e9bd7e9d101287b4466475561df9131f0ef56a6.tar.xz
tangerine-wallet-browser-2e9bd7e9d101287b4466475561df9131f0ef56a6.tar.zst
tangerine-wallet-browser-2e9bd7e9d101287b4466475561df9131f0ef56a6.zip
Merge pull request #4717 from MetaMask/chrome-promise-bugfix
Conditionally use Promise-based extension API when creating windows
-rw-r--r--app/scripts/lib/notification-manager.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/app/scripts/lib/notification-manager.js b/app/scripts/lib/notification-manager.js
index 6b88a7a99..969a9459a 100644
--- a/app/scripts/lib/notification-manager.js
+++ b/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)
}
})
}