aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2016-09-09 06:43:51 +0800
committerDan Finlay <dan@danfinlay.com>2016-09-09 06:43:51 +0800
commit4a7eab5b1aee8b122d06903bc032849d1c35a3a9 (patch)
tree3911014fabd11677573538727edbb95068457338 /ui
parent6c05c221cd8e8bef2ce4efc5ae03ee7a39e3e0bf (diff)
parentfc0f64a5a8cf23c0feed2e2583cf07de7c9548a5 (diff)
downloadtangerine-wallet-browser-4a7eab5b1aee8b122d06903bc032849d1c35a3a9.tar
tangerine-wallet-browser-4a7eab5b1aee8b122d06903bc032849d1c35a3a9.tar.gz
tangerine-wallet-browser-4a7eab5b1aee8b122d06903bc032849d1c35a3a9.tar.bz2
tangerine-wallet-browser-4a7eab5b1aee8b122d06903bc032849d1c35a3a9.tar.lz
tangerine-wallet-browser-4a7eab5b1aee8b122d06903bc032849d1c35a3a9.tar.xz
tangerine-wallet-browser-4a7eab5b1aee8b122d06903bc032849d1c35a3a9.tar.zst
tangerine-wallet-browser-4a7eab5b1aee8b122d06903bc032849d1c35a3a9.zip
Merge branch 'master' into FixLogoLeak
Diffstat (limited to 'ui')
-rw-r--r--ui/app/account-detail.js2
-rw-r--r--ui/app/accounts/index.js1
-rw-r--r--ui/app/conf-tx.js4
-rw-r--r--ui/app/reducers/app.js9
-rw-r--r--ui/index.js5
-rw-r--r--ui/lib/tx-helper.js4
6 files changed, 16 insertions, 9 deletions
diff --git a/ui/app/account-detail.js b/ui/app/account-detail.js
index cc956fed3..ebb15cd05 100644
--- a/ui/app/account-detail.js
+++ b/ui/app/account-detail.js
@@ -235,7 +235,7 @@ AccountDetailScreen.prototype.subview = function () {
AccountDetailScreen.prototype.transactionList = function () {
const { transactions, unconfTxs, unconfMsgs, address, network, shapeShiftTxList } = this.props
- var txsToRender = transactions
+ var txsToRender = transactions.concat(unconfTxs)
// only transactions that are from the current address
.filter(tx => tx.txParams.from === address)
// only transactions that are on the current network
diff --git a/ui/app/accounts/index.js b/ui/app/accounts/index.js
index 6e12accc7..c20900c1e 100644
--- a/ui/app/accounts/index.js
+++ b/ui/app/accounts/index.js
@@ -11,6 +11,7 @@ module.exports = connect(mapStateToProps)(AccountsScreen)
function mapStateToProps (state) {
const pendingTxs = valuesFor(state.metamask.unconfTxs)
+ .filter(tx => tx.txParams.metamaskNetworkId === state.metamask.network)
const pendingMsgs = valuesFor(state.metamask.unconfMsgs)
const pending = pendingTxs.concat(pendingMsgs)
diff --git a/ui/app/conf-tx.js b/ui/app/conf-tx.js
index 22d29383f..99b4bc9f1 100644
--- a/ui/app/conf-tx.js
+++ b/ui/app/conf-tx.js
@@ -21,6 +21,7 @@ function mapStateToProps (state) {
unconfMsgs: state.metamask.unconfMsgs,
index: state.appState.currentView.context,
warning: state.appState.warning,
+ network: state.metamask.network,
}
}
@@ -32,9 +33,10 @@ function ConfirmTxScreen () {
ConfirmTxScreen.prototype.render = function () {
var state = this.props
+ var network = state.network
var unconfTxs = state.unconfTxs
var unconfMsgs = state.unconfMsgs
- var unconfTxList = txHelper(unconfTxs, unconfMsgs)
+ var unconfTxList = txHelper(unconfTxs, unconfMsgs, network)
var index = state.index !== undefined ? state.index : 0
var txData = unconfTxList[index] || unconfTxList[0] || {}
var isNotification = isPopupOrNotification() === 'notification'
diff --git a/ui/app/reducers/app.js b/ui/app/reducers/app.js
index bad11113a..a6cd9ca1b 100644
--- a/ui/app/reducers/app.js
+++ b/ui/app/reducers/app.js
@@ -258,8 +258,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 +524,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) {
diff --git a/ui/index.js b/ui/index.js
index 8cf74f6ee..0e69b00d6 100644
--- a/ui/index.js
+++ b/ui/index.js
@@ -3,7 +3,7 @@ const h = require('react-hyperscript')
const Root = require('./app/root')
const actions = require('./app/actions')
const configureStore = require('./app/store')
-
+const txHelper = require('./lib/tx-helper')
module.exports = launchApp
function launchApp (opts) {
@@ -34,7 +34,8 @@ function startApp (metamaskState, accountManager, opts) {
})
// if unconfirmed txs, start on txConf page
- if (Object.keys(metamaskState.unconfTxs || {}).length) {
+ var unconfirmedTxsAll = txHelper(metamaskState.unconfTxs, metamaskState.unconfMsgs, metamaskState.network)
+ if (unconfirmedTxsAll.length > 0) {
store.dispatch(actions.showConfTxPage())
}
diff --git a/ui/lib/tx-helper.js b/ui/lib/tx-helper.js
index 8f15cd3cc..c984bc9af 100644
--- a/ui/lib/tx-helper.js
+++ b/ui/lib/tx-helper.js
@@ -1,7 +1,7 @@
const valuesFor = require('../app/util').valuesFor
-module.exports = function (unconfTxs, unconfMsgs) {
- var txValues = valuesFor(unconfTxs)
+module.exports = function (unconfTxs, unconfMsgs, network) {
+ var txValues = network ? valuesFor(unconfTxs).filter(tx => tx.txParams.metamaskNetworkId === network) : valuesFor(unconfTxs)
var msgValues = valuesFor(unconfMsgs)
var allValues = txValues.concat(msgValues)
return allValues.sort(tx => tx.time)