aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/lib
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2016-08-24 02:40:08 +0800
committerDan Finlay <dan@danfinlay.com>2016-08-24 02:40:08 +0800
commit4fb49dfb4b3f23a5510c5a958671e9454d214a11 (patch)
tree369803421d0efb92782ca9f8f387dc2f7d5e728b /app/scripts/lib
parente5ca83d2bf7e97131e20da0ad352a38c7f8a2f86 (diff)
downloadtangerine-wallet-browser-4fb49dfb4b3f23a5510c5a958671e9454d214a11.tar
tangerine-wallet-browser-4fb49dfb4b3f23a5510c5a958671e9454d214a11.tar.gz
tangerine-wallet-browser-4fb49dfb4b3f23a5510c5a958671e9454d214a11.tar.bz2
tangerine-wallet-browser-4fb49dfb4b3f23a5510c5a958671e9454d214a11.tar.lz
tangerine-wallet-browser-4fb49dfb4b3f23a5510c5a958671e9454d214a11.tar.xz
tangerine-wallet-browser-4fb49dfb4b3f23a5510c5a958671e9454d214a11.tar.zst
tangerine-wallet-browser-4fb49dfb4b3f23a5510c5a958671e9454d214a11.zip
Close popup even if last tx is dismissed from main UI
Diffstat (limited to 'app/scripts/lib')
-rw-r--r--app/scripts/lib/notifications.js22
1 files changed, 14 insertions, 8 deletions
diff --git a/app/scripts/lib/notifications.js b/app/scripts/lib/notifications.js
index 4c2aa91de..cf4e1c216 100644
--- a/app/scripts/lib/notifications.js
+++ b/app/scripts/lib/notifications.js
@@ -2,19 +2,15 @@ const extension = require('./extension')
const notifications = {
show: showNotification,
+ getPopup,
}
module.exports = notifications
window.METAMASK_NOTIFIER = notifications
function showNotification() {
- extension.windows.getAll({}, (windows) => {
-
- let popupWindow = windows.find((win) => {
- return win.type === 'popup'
- })
-
- if (popupWindow) {
- return extension.windows.update(popupWindow.id, { focused: true })
+ getPopup((popup) => {
+ if (popup) {
+ return extension.windows.update(popup.id, { focused: true })
}
extension.windows.create({
@@ -27,3 +23,13 @@ function showNotification() {
})
}
+function getPopup(cb) {
+ extension.windows.getAll({}, (windows) => {
+ let popup = windows.find((win) => {
+ return win.type === 'popup'
+ })
+
+ cb(popup)
+ })
+}
+