aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorvittominacori <vittoriominacori@gmail.com>2018-06-18 01:16:30 +0800
committervittominacori <vittoriominacori@gmail.com>2018-06-18 01:16:30 +0800
commitff3c2626213afa48151c43947087aae95298d5f6 (patch)
tree9b0f80dc1e172ce5f16a5de93e8793aae40bb73f /app
parent4c1b526137379969d16386f50ca3214d90c67c3f (diff)
downloadtangerine-wallet-browser-ff3c2626213afa48151c43947087aae95298d5f6.tar
tangerine-wallet-browser-ff3c2626213afa48151c43947087aae95298d5f6.tar.gz
tangerine-wallet-browser-ff3c2626213afa48151c43947087aae95298d5f6.tar.bz2
tangerine-wallet-browser-ff3c2626213afa48151c43947087aae95298d5f6.tar.lz
tangerine-wallet-browser-ff3c2626213afa48151c43947087aae95298d5f6.tar.xz
tangerine-wallet-browser-ff3c2626213afa48151c43947087aae95298d5f6.tar.zst
tangerine-wallet-browser-ff3c2626213afa48151c43947087aae95298d5f6.zip
set the popup id returned by create promise
Diffstat (limited to 'app')
-rw-r--r--app/scripts/lib/notification-manager.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/app/scripts/lib/notification-manager.js b/app/scripts/lib/notification-manager.js
index 4a5d21e2f..6b88a7a99 100644
--- a/app/scripts/lib/notification-manager.js
+++ b/app/scripts/lib/notification-manager.js
@@ -28,11 +28,12 @@ class NotificationManager {
} else {
// create new notification popup
extension.windows.create({
- id: 'metamask-popup',
url: 'notification.html',
type: 'popup',
width,
height,
+ }).then((currentPopup) => {
+ this._popupId = currentPopup.id
})
}
})
@@ -85,7 +86,7 @@ class NotificationManager {
}
/**
- * Given an array of windows, returns the first that has a 'popup' type, or null if no such window exists.
+ * Given an array of windows, returns the 'popup' that has been opened by MetaMask, or null if no such window exists.
*
* @private
* @param {array} windows An array of objects containing data about the open MetaMask extension windows.
@@ -94,7 +95,7 @@ class NotificationManager {
_getPopupIn (windows) {
return windows ? windows.find((win) => {
// Returns notification popup
- return (win && win.type === 'popup' && win.id === 'metamask-popup')
+ return (win && win.type === 'popup' && win.id === this._popupId)
}) : null
}