diff options
author | Dan Finlay <dan@danfinlay.com> | 2017-02-24 06:23:45 +0800 |
---|---|---|
committer | Dan Finlay <dan@danfinlay.com> | 2017-02-24 06:23:45 +0800 |
commit | 4697aca02c669b1787e72f0648b3043270867799 (patch) | |
tree | ecc07db1ce05ec6a88612a0fa7d1c86007ef6389 /ui/app/reducers | |
parent | 7ec25526b70473247a69ab4a3a1302e50b06f12b (diff) | |
download | tangerine-wallet-browser-4697aca02c669b1787e72f0648b3043270867799.tar tangerine-wallet-browser-4697aca02c669b1787e72f0648b3043270867799.tar.gz tangerine-wallet-browser-4697aca02c669b1787e72f0648b3043270867799.tar.bz2 tangerine-wallet-browser-4697aca02c669b1787e72f0648b3043270867799.tar.lz tangerine-wallet-browser-4697aca02c669b1787e72f0648b3043270867799.tar.xz tangerine-wallet-browser-4697aca02c669b1787e72f0648b3043270867799.tar.zst tangerine-wallet-browser-4697aca02c669b1787e72f0648b3043270867799.zip |
Got personal_sign working
Also fixed bug where signing would not close popup.
Diffstat (limited to 'ui/app/reducers')
-rw-r--r-- | ui/app/reducers/app.js | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/ui/app/reducers/app.js b/ui/app/reducers/app.js index de6536c2e..6d92764f1 100644 --- a/ui/app/reducers/app.js +++ b/ui/app/reducers/app.js @@ -6,6 +6,7 @@ const notification = require('../../../app/scripts/lib/notifications') module.exports = reduceApp function reduceApp (state, action) { + log.debug('App Reducer got ' + action.type) // clone and defaults const selectedAddress = state.metamask.selectedAddress const pendingTxs = hasPendingTxs(state) @@ -289,32 +290,36 @@ function reduceApp (state, action) { case actions.SHOW_CONF_TX_PAGE: return extend(appState, { currentView: { - name: 'confTx', + name: pendingTxs ? 'confTx' : 'account-detail', context: 0, }, transForward: action.transForward, warning: null, + isLoading: false, }) case actions.SHOW_CONF_MSG_PAGE: return extend(appState, { currentView: { - name: 'confTx', + name: pendingTxs ? 'confTx' : 'account-detail', context: 0, }, transForward: true, warning: null, + isLoading: false, }) case actions.COMPLETED_TX: - var unapprovedTxs = state.metamask.unapprovedTxs - var unapprovedMsgs = state.metamask.unapprovedMsgs - var network = state.metamask.network + log.debug('reducing COMPLETED_TX') + var { unapprovedTxs, unapprovedMsgs, + unapprovedPersonalMsgs, network } = state.metamask - var unconfTxList = txHelper(unapprovedTxs, unapprovedMsgs, network) - .filter(tx => tx !== tx.id) + var unconfTxList = txHelper(unapprovedTxs, unapprovedMsgs, unapprovedPersonalMsgs, network) + .filter(tx => tx !== tx.id) + log.debug(`actions - COMPLETED_TX with ${unconfTxList.length} txs`) if (unconfTxList && unconfTxList.length > 0) { + log.debug('reducer detected txs - rendering confTx view') return extend(appState, { transForward: false, currentView: { @@ -324,6 +329,7 @@ function reduceApp (state, action) { warning: null, }) } else { + log.debug('attempting to close popup') notification.closePopup() return extend(appState, { @@ -572,10 +578,12 @@ function reduceApp (state, action) { } function hasPendingTxs (state) { - var unapprovedTxs = state.metamask.unapprovedTxs - var unapprovedMsgs = state.metamask.unapprovedMsgs - var network = state.metamask.network - var unconfTxList = txHelper(unapprovedTxs, unapprovedMsgs, network) + var { unapprovedTxs, unapprovedMsgs, + unapprovedPersonalMsgs, network } = state.metamask + + var unconfTxList = txHelper(unapprovedTxs, unapprovedMsgs, unapprovedPersonalMsgs, network) + var has = unconfTxList.length > 0 + log.debug('checking if state has pending txs, concluded ' + has) return unconfTxList.length > 0 } |