diff options
author | Dan Finlay <dan@danfinlay.com> | 2016-08-24 02:40:08 +0800 |
---|---|---|
committer | Dan Finlay <dan@danfinlay.com> | 2016-08-24 02:40:08 +0800 |
commit | 4fb49dfb4b3f23a5510c5a958671e9454d214a11 (patch) | |
tree | 369803421d0efb92782ca9f8f387dc2f7d5e728b /ui/app/reducers | |
parent | e5ca83d2bf7e97131e20da0ad352a38c7f8a2f86 (diff) | |
download | tangerine-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 'ui/app/reducers')
-rw-r--r-- | ui/app/reducers/app.js | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/ui/app/reducers/app.js b/ui/app/reducers/app.js index 94b7e8bf7..7bd1dfd1f 100644 --- a/ui/app/reducers/app.js +++ b/ui/app/reducers/app.js @@ -2,6 +2,7 @@ const extend = require('xtend') const actions = require('../actions') const txHelper = require('../../lib/tx-helper') const extension = require('../../../app/scripts/lib/extension') +const notification = require('../../../app/scripts/lib/notifications') module.exports = reduceApp @@ -252,12 +253,7 @@ function reduceApp (state, action) { }) } else { - const isNotification = window.METAMASK_UI_TYPE === 'notification' - if (isNotification) { - extension.windows.getCurrent({}, (win) => { - extension.windows.remove(win.id, console.error) - }) - } + closePopupIfOpen() return extend(appState, { transForward: false, @@ -524,4 +520,9 @@ function indexForPending (state, txId) { return idx } - +function closePopupIfOpen() { + notification.getPopup((popup) => { + if (!popup) return + extension.windows.remove(popup.id, console.error) + }) +} |