diff options
author | Thomas Huang <tmashuang@users.noreply.github.com> | 2018-06-21 06:50:07 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-21 06:50:07 +0800 |
commit | 46b2f1df11b83e961ebb3adb96c2e8cd116f9ae3 (patch) | |
tree | bf3a6a153034cb0ecc7515507315fb76ac64dc32 /app/scripts/lib | |
parent | 41a48195ad76c268cfadc637a451ebe0281f058f (diff) | |
parent | ff3c2626213afa48151c43947087aae95298d5f6 (diff) | |
download | tangerine-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/lib')
-rw-r--r-- | app/scripts/lib/notification-manager.js | 6 |
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 } |