aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/reducers/app.js
diff options
context:
space:
mode:
authorFrankie <frankie.pangilinan@consensys.net>2016-09-09 03:56:04 +0800
committerFrankie <frankie.pangilinan@consensys.net>2016-09-09 03:56:04 +0800
commit6f86c5f8ee6779eddfde1fbc32e356bbc80708f3 (patch)
tree3458a0b05c8e0664ae6d853b47a385225ea722d2 /ui/app/reducers/app.js
parent5f8d3085d7603135849eb22ad22c70733c236c2d (diff)
downloadtangerine-wallet-browser-6f86c5f8ee6779eddfde1fbc32e356bbc80708f3.tar
tangerine-wallet-browser-6f86c5f8ee6779eddfde1fbc32e356bbc80708f3.tar.gz
tangerine-wallet-browser-6f86c5f8ee6779eddfde1fbc32e356bbc80708f3.tar.bz2
tangerine-wallet-browser-6f86c5f8ee6779eddfde1fbc32e356bbc80708f3.tar.lz
tangerine-wallet-browser-6f86c5f8ee6779eddfde1fbc32e356bbc80708f3.tar.xz
tangerine-wallet-browser-6f86c5f8ee6779eddfde1fbc32e356bbc80708f3.tar.zst
tangerine-wallet-browser-6f86c5f8ee6779eddfde1fbc32e356bbc80708f3.zip
Add network checks for unconfirmed Txs
Diffstat (limited to 'ui/app/reducers/app.js')
-rw-r--r--ui/app/reducers/app.js19
1 files changed, 16 insertions, 3 deletions
diff --git a/ui/app/reducers/app.js b/ui/app/reducers/app.js
index bad11113a..29d5d9378 100644
--- a/ui/app/reducers/app.js
+++ b/ui/app/reducers/app.js
@@ -7,6 +7,7 @@ module.exports = reduceApp
function reduceApp (state, action) {
// clone and defaults
+ console.log(action.type)
const selectedAccount = state.metamask.selectedAccount
const pendingTxs = hasPendingTxs(state)
let name = 'accounts'
@@ -15,6 +16,15 @@ function reduceApp (state, action) {
}
if (pendingTxs) {
name = 'confTx'
+ } else {
+ try {
+ if (state.appState.currentView.name === 'confTx') {
+ name = 'accountDetail'
+ }
+ } catch (e) {
+ null
+ }
+
}
var defaultView = {
@@ -258,8 +268,9 @@ function reduceApp (state, action) {
case actions.COMPLETED_TX:
var unconfTxs = state.metamask.unconfTxs
var unconfMsgs = state.metamask.unconfMsgs
+ var network = state.metamask.network
- var unconfTxList = txHelper(unconfTxs, unconfMsgs)
+ var unconfTxList = txHelper(unconfTxs, unconfMsgs, network)
.filter(tx => tx !== tx.id)
if (unconfTxList && unconfTxList.length > 0) {
@@ -523,14 +534,16 @@ function reduceApp (state, action) {
function hasPendingTxs (state) {
var unconfTxs = state.metamask.unconfTxs
var unconfMsgs = state.metamask.unconfMsgs
- var unconfTxList = txHelper(unconfTxs, unconfMsgs)
+ var network = state.metamask.network
+ var unconfTxList = txHelper(unconfTxs, unconfMsgs, network)
return unconfTxList.length > 0
}
function indexForPending (state, txId) {
var unconfTxs = state.metamask.unconfTxs
var unconfMsgs = state.metamask.unconfMsgs
- var unconfTxList = txHelper(unconfTxs, unconfMsgs)
+ var network = state.metamask.network
+ var unconfTxList = txHelper(unconfTxs, unconfMsgs, network)
let idx
unconfTxList.forEach((tx, i) => {
if (tx.id === txId) {