From badf0ce3142b97631dc2ba559a68005258625026 Mon Sep 17 00:00:00 2001 From: bitpshr Date: Tue, 3 Jul 2018 13:20:05 -0400 Subject: Conditionally use Promise-based extension API when creating windows --- app/scripts/lib/notification-manager.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'app/scripts/lib/notification-manager.js') 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) } }) } -- cgit