aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/lib/notification-manager.js
diff options
context:
space:
mode:
authorbitpshr <mail@bitpshr.net>2018-07-04 01:20:05 +0800
committerbitpshr <mail@bitpshr.net>2018-07-04 01:33:13 +0800
commitbadf0ce3142b97631dc2ba559a68005258625026 (patch)
tree0542de50fa5d7b6191b6cdfab8b8db566da1b72f /app/scripts/lib/notification-manager.js
parent1f0cf11af1c94e750bbc4c5238c3ee028350a6c6 (diff)
downloadtangerine-wallet-browser-badf0ce3142b97631dc2ba559a68005258625026.tar
tangerine-wallet-browser-badf0ce3142b97631dc2ba559a68005258625026.tar.gz
tangerine-wallet-browser-badf0ce3142b97631dc2ba559a68005258625026.tar.bz2
tangerine-wallet-browser-badf0ce3142b97631dc2ba559a68005258625026.tar.lz
tangerine-wallet-browser-badf0ce3142b97631dc2ba559a68005258625026.tar.xz
tangerine-wallet-browser-badf0ce3142b97631dc2ba559a68005258625026.tar.zst
tangerine-wallet-browser-badf0ce3142b97631dc2ba559a68005258625026.zip
Conditionally use Promise-based extension API when creating windows
Diffstat (limited to 'app/scripts/lib/notification-manager.js')
-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)
}
})
}