aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts
diff options
context:
space:
mode:
authorThomas Huang <tmashuang@users.noreply.github.com>2018-06-21 06:50:07 +0800
committerGitHub <noreply@github.com>2018-06-21 06:50:07 +0800
commit46b2f1df11b83e961ebb3adb96c2e8cd116f9ae3 (patch)
treebf3a6a153034cb0ecc7515507315fb76ac64dc32 /app/scripts
parent41a48195ad76c268cfadc637a451ebe0281f058f (diff)
parentff3c2626213afa48151c43947087aae95298d5f6 (diff)
downloadtangerine-wallet-browser-46b2f1df11b83e961ebb3adb96c2e8cd116f9ae3.tar
tangerine-wallet-browser-46b2f1df11b83e961ebb3adb96c2e8cd116f9ae3.tar.gz
tangerine-wallet-browser-46b2f1df11b83e961ebb3adb96c2e8cd116f9ae3.tar.bz2
tangerine-wallet-browser-46b2f1df11b83e961ebb3adb96c2e8cd116f9ae3.tar.lz
tangerine-wallet-browser-46b2f1df11b83e961ebb3adb96c2e8cd116f9ae3.tar.xz
tangerine-wallet-browser-46b2f1df11b83e961ebb3adb96c2e8cd116f9ae3.tar.zst
tangerine-wallet-browser-46b2f1df11b83e961ebb3adb96c2e8cd116f9ae3.zip
Merge pull request #4592 from vittominacori/fix/close-popup-bug-#4553
set an id to the metamask notification popup
Diffstat (limited to 'app/scripts')
-rw-r--r--app/scripts/lib/notification-manager.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/app/scripts/lib/notification-manager.js b/app/scripts/lib/notification-manager.js
index 5dfb42078..6b88a7a99 100644
--- a/app/scripts/lib/notification-manager.js
+++ b/app/scripts/lib/notification-manager.js
@@ -32,6 +32,8 @@ class NotificationManager {
type: 'popup',
width,
height,
+ }).then((currentPopup) => {
+ this._popupId = currentPopup.id
})
}
})
@@ -84,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.
@@ -93,7 +95,7 @@ class NotificationManager {
_getPopupIn (windows) {
return windows ? windows.find((win) => {
// Returns notification popup
- return (win && win.type === 'popup')
+ return (win && win.type === 'popup' && win.id === this._popupId)
}) : null
}