aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkumavis <aaron@kumavis.me>2017-04-01 04:32:47 +0800
committerkumavis <aaron@kumavis.me>2017-04-01 04:32:47 +0800
commit60a48e713fb341c0eba893bd0c37e02315c8b320 (patch)
tree2bbec4765bacfa6a3c779c91a9caa87fd4c41227
parent49d8877fd78b8251b6856292ca71a55773a74b0e (diff)
downloadtangerine-wallet-browser-60a48e713fb341c0eba893bd0c37e02315c8b320.tar
tangerine-wallet-browser-60a48e713fb341c0eba893bd0c37e02315c8b320.tar.gz
tangerine-wallet-browser-60a48e713fb341c0eba893bd0c37e02315c8b320.tar.bz2
tangerine-wallet-browser-60a48e713fb341c0eba893bd0c37e02315c8b320.tar.lz
tangerine-wallet-browser-60a48e713fb341c0eba893bd0c37e02315c8b320.tar.xz
tangerine-wallet-browser-60a48e713fb341c0eba893bd0c37e02315c8b320.tar.zst
tangerine-wallet-browser-60a48e713fb341c0eba893bd0c37e02315c8b320.zip
ui - move popup auto-close after tx conf to ui entrypoint
-rw-r--r--app/scripts/popup.js6
-rw-r--r--ui/app/reducers/app.js9
2 files changed, 9 insertions, 6 deletions
diff --git a/app/scripts/popup.js b/app/scripts/popup.js
index f6dcb829b..ce18dc422 100644
--- a/app/scripts/popup.js
+++ b/app/scripts/popup.js
@@ -17,13 +17,17 @@ global.METAMASK_UI_TYPE = windowType
closePopupIfOpen(windowType)
// setup stream to background
-const extensionPort = extension.runtime.connect({ windowType })
+const extensionPort = extension.runtime.connect({ name: windowType })
const connectionStream = new PortStream(extensionPort)
// start ui
const container = document.getElementById('app-content')
startPopup({ container, connectionStream }, (err, store) => {
if (err) return displayCriticalError(err)
+ store.subscribe(() => {
+ const state = store.getState()
+ if (state.appState.shouldClose) notificationManager.closePopup()
+ })
})
diff --git a/ui/app/reducers/app.js b/ui/app/reducers/app.js
index 46b27fe25..7ad1229e5 100644
--- a/ui/app/reducers/app.js
+++ b/ui/app/reducers/app.js
@@ -1,12 +1,10 @@
const extend = require('xtend')
const actions = require('../actions')
const txHelper = require('../../lib/tx-helper')
-const NotificationManager = require('../../../app/scripts/lib/notification-manager')
-
-const notificationManager = new NotificationManager()
module.exports = reduceApp
+
function reduceApp (state, action) {
log.debug('App Reducer got ' + action.type)
// clone and defaults
@@ -36,6 +34,7 @@ function reduceApp (state, action) {
// default state
var appState = extend({
+ shouldClose: false,
menuOpen: false,
currentView: seedWords ? seedConfView : defaultView,
accountDetail: {
@@ -331,9 +330,9 @@ function reduceApp (state, action) {
})
} else {
log.debug('attempting to close popup')
- notificationManager.closePopup()
-
return extend(appState, {
+ // indicate notification should close
+ shouldClose: true,
transForward: false,
warning: null,
currentView: {