aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2017-10-06 02:55:23 +0800
committerDan Finlay <dan@danfinlay.com>2017-10-06 02:55:23 +0800
commitc5b7880f051b1ee47a9f8eecc6ea5c553f9efa6c (patch)
tree8b3ee94a666dd23aa9a3f9579abaf39939a0d161 /ui/app/components
parente11ca1289019123cd143adcb6312186452630723 (diff)
parent35f4148343cf4400f7a38eef07282cae44cd0335 (diff)
downloadtangerine-wallet-browser-c5b7880f051b1ee47a9f8eecc6ea5c553f9efa6c.tar.gz
tangerine-wallet-browser-c5b7880f051b1ee47a9f8eecc6ea5c553f9efa6c.tar.zst
tangerine-wallet-browser-c5b7880f051b1ee47a9f8eecc6ea5c553f9efa6c.zip
Merge branch 'master' into SignTypedData
Diffstat (limited to 'ui/app/components')
-rw-r--r--ui/app/components/pending-tx.js6
-rw-r--r--ui/app/components/transaction-list-item.js34
2 files changed, 25 insertions, 15 deletions
diff --git a/ui/app/components/pending-tx.js b/ui/app/components/pending-tx.js
index 6f8c19a3c..c3350fcc1 100644
--- a/ui/app/components/pending-tx.js
+++ b/ui/app/components/pending-tx.js
@@ -33,7 +33,7 @@ function PendingTx () {
PendingTx.prototype.render = function () {
const props = this.props
- const { currentCurrency, blockGasLimit, computedBalances } = props
+ const { currentCurrency, blockGasLimit } = props
const conversionRate = props.conversionRate
const txMeta = this.gatherTxMeta()
@@ -42,8 +42,8 @@ PendingTx.prototype.render = function () {
// Account Details
const address = txParams.from || props.selectedAddress
const identity = props.identities[address] || { address: address }
- const account = computedBalances[address]
- const balance = account ? account.ethBalance : '0x0'
+ const account = props.accounts[address]
+ const balance = account ? account.balance : '0x0'
// recipient check
const isValidAddress = !txParams.to || util.isValidAddress(txParams.to)
diff --git a/ui/app/components/transaction-list-item.js b/ui/app/components/transaction-list-item.js
index 0e5c0b5a3..a9961f47c 100644
--- a/ui/app/components/transaction-list-item.js
+++ b/ui/app/components/transaction-list-item.js
@@ -133,7 +133,7 @@ function recipientField (txParams, transaction, isTx, isMsg) {
},
}, [
message,
- failIfFailed(transaction),
+ renderErrorOrWarning(transaction),
])
}
@@ -141,25 +141,35 @@ function formatDate (date) {
return vreme.format(new Date(date), 'March 16 2014 14:30')
}
-function failIfFailed (transaction) {
- if (transaction.status === 'rejected') {
+function renderErrorOrWarning (transaction) {
+ const { status, err, warning } = transaction
+
+ // show rejected
+ if (status === 'rejected') {
return h('span.error', ' (Rejected)')
}
- if (transaction.err || transaction.warning) {
- const { err, warning = {} } = transaction
- const errFirst = !!(( err && warning ) || err)
- const message = errFirst ? err.message : warning.message
-
- errFirst ? err.message : warning.message
+ // show error
+ if (err) {
+ const message = err.message || ''
+ return (
+ h(Tooltip, {
+ title: message,
+ position: 'bottom',
+ }, [
+ h(`span.error`, ` (Failed)`),
+ ])
+ )
+ }
+ // show warning
+ if (warning) {
+ const message = warning.message
return h(Tooltip, {
title: message,
position: 'bottom',
}, [
- h(`span.${errFirst ? 'error' : 'warning'}`,
- ` (${errFirst ? 'Failed' : 'Warning'})`
- ),
+ h(`span.warning`, ` (Warning)`),
])
}
}