aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/lib/notification-manager.js
diff options
context:
space:
mode:
authorkumavis <kumavis@users.noreply.github.com>2018-03-22 03:42:03 +0800
committerGitHub <noreply@github.com>2018-03-22 03:42:03 +0800
commit278e1ba61eab97860be295ad938cf47ce22f11ed (patch)
tree0d1f23170865e44409c8ee552ec41c993044a4ab /app/scripts/lib/notification-manager.js
parenta80be4c8c37464ec6b5071482756f0cb7532924c (diff)
parent1343f5ede466c4fd8057795478ad21d0382d73cb (diff)
downloadtangerine-wallet-browser-278e1ba61eab97860be295ad938cf47ce22f11ed.tar
tangerine-wallet-browser-278e1ba61eab97860be295ad938cf47ce22f11ed.tar.gz
tangerine-wallet-browser-278e1ba61eab97860be295ad938cf47ce22f11ed.tar.bz2
tangerine-wallet-browser-278e1ba61eab97860be295ad938cf47ce22f11ed.tar.lz
tangerine-wallet-browser-278e1ba61eab97860be295ad938cf47ce22f11ed.tar.xz
tangerine-wallet-browser-278e1ba61eab97860be295ad938cf47ce22f11ed.tar.zst
tangerine-wallet-browser-278e1ba61eab97860be295ad938cf47ce22f11ed.zip
Merge pull request #3656 from MetaMask/trigun0x2-master2
Prevent batch request from opening multiple windows (3)
Diffstat (limited to 'app/scripts/lib/notification-manager.js')
-rw-r--r--app/scripts/lib/notification-manager.js11
1 files changed, 6 insertions, 5 deletions
diff --git a/app/scripts/lib/notification-manager.js b/app/scripts/lib/notification-manager.js
index adaf60c65..1fcb7cf69 100644
--- a/app/scripts/lib/notification-manager.js
+++ b/app/scripts/lib/notification-manager.js
@@ -13,11 +13,12 @@ class NotificationManager {
this._getPopup((err, popup) => {
if (err) throw err
+ // Bring focus to chrome popup
if (popup) {
- // bring focus to existing popup
+ // bring focus to existing chrome popup
extension.windows.update(popup.id, { focused: true })
} else {
- // create new popup
+ // create new notification popup
extension.windows.create({
url: 'notification.html',
type: 'popup',
@@ -29,6 +30,7 @@ class NotificationManager {
}
closePopup () {
+ // closes notification popup
this._getPopup((err, popup) => {
if (err) throw err
if (!popup) return
@@ -60,9 +62,8 @@ class NotificationManager {
_getPopupIn (windows) {
return windows ? windows.find((win) => {
- return (win && win.type === 'popup' &&
- win.height === height &&
- win.width === width)
+ // Returns notification popup
+ return (win && win.type === 'popup')
}) : null
}