aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/reducers/app.js
diff options
context:
space:
mode:
authorkumavis <kumavis@users.noreply.github.com>2016-05-05 02:11:37 +0800
committerkumavis <kumavis@users.noreply.github.com>2016-05-05 02:11:37 +0800
commit95582f8bde3abda5b6b7cf0e027bc7913e5953ce (patch)
tree6409dd6ea4aee0f58e243959568a4dca3fd0e63d /ui/app/reducers/app.js
parentdcbf17af2d547ce676178bf78328d5c01135e31a (diff)
parent9c6ec054b13f24e88b78ca4124b0d3a46234b1d7 (diff)
downloadtangerine-wallet-browser-95582f8bde3abda5b6b7cf0e027bc7913e5953ce.tar.gz
tangerine-wallet-browser-95582f8bde3abda5b6b7cf0e027bc7913e5953ce.tar.zst
tangerine-wallet-browser-95582f8bde3abda5b6b7cf0e027bc7913e5953ce.zip
Merge pull request #169 from MetaMask/ImplementEthSign
implement eth_sign
Diffstat (limited to 'ui/app/reducers/app.js')
-rw-r--r--ui/app/reducers/app.js28
1 files changed, 21 insertions, 7 deletions
diff --git a/ui/app/reducers/app.js b/ui/app/reducers/app.js
index 57cdccbac..14f92a8c5 100644
--- a/ui/app/reducers/app.js
+++ b/ui/app/reducers/app.js
@@ -1,6 +1,7 @@
const extend = require('xtend')
const actions = require('../actions')
const valuesFor = require('../util').valuesFor
+const txHelper = require('../../lib/tx-helper')
module.exports = reduceApp
@@ -107,6 +108,7 @@ function reduceApp(state, action) {
case actions.UNLOCK_METAMASK:
return extend(appState, {
+ currentView: {},
transForward: true,
warning: null,
})
@@ -127,10 +129,7 @@ function reduceApp(state, action) {
case actions.GO_HOME:
return extend(appState, {
- currentView: {
- name: 'accountDetail',
- context: appState.currentView.context,
- },
+ currentView: {},
accountDetail: {
accountExport: 'none',
privateKey: '',
@@ -185,9 +184,24 @@ function reduceApp(state, action) {
warning: null,
})
+ case actions.SHOW_CONF_MSG_PAGE:
+ return extend(appState, {
+ currentView: {
+ name: 'confTx',
+ context: 0,
+ },
+ transForward: true,
+ warning: null,
+ })
+
case actions.COMPLETED_TX:
- var unconfTxs = Object.keys(state.metamask.unconfTxs).filter(tx => tx !== tx.id)
- if (unconfTxs && unconfTxs.length > 0) {
+ var unconfTxs = state.metamask.unconfTxs
+ var unconfMsgs = state.metamask.unconfMsgs
+
+ var unconfTxList = txHelper(unconfTxs, unconfMsgs)
+ .filter(tx => tx !== tx.id)
+
+ if (unconfTxList && unconfTxList.length > 0) {
return extend(appState, {
transForward: false,
currentView: {
@@ -202,7 +216,7 @@ function reduceApp(state, action) {
warning: null,
currentView: {
name: 'accountDetail',
- context: appState.currentView.context,
+ context: state.metamask.selectedAddress,
},
})
}