diff options
author | Chi Kei Chan <chikeichan@gmail.com> | 2017-10-04 07:02:58 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-04 07:02:58 +0800 |
commit | bd99bc2e88b44b13ca818fbba478bd74eef222e3 (patch) | |
tree | 8a653f7015c89305d5c1d35ffc70ab52a30ddb0c /ui/app/components | |
parent | ac4868170f4c61d13291389d01bf1002fe240ed4 (diff) | |
parent | f12504cd09f136fb5ac0d4dd2a6afab8fa6e6524 (diff) | |
download | tangerine-wallet-browser-bd99bc2e88b44b13ca818fbba478bd74eef222e3.tar.gz tangerine-wallet-browser-bd99bc2e88b44b13ca818fbba478bd74eef222e3.tar.zst tangerine-wallet-browser-bd99bc2e88b44b13ca818fbba478bd74eef222e3.zip |
Merge branch 'master' into NewUI-flat
Diffstat (limited to 'ui/app/components')
-rw-r--r-- | ui/app/components/transaction-list-item.js | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/ui/app/components/transaction-list-item.js b/ui/app/components/transaction-list-item.js index a40066dc7..3ea466d24 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,8 +141,11 @@ 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) { @@ -152,14 +155,27 @@ function failIfFailed (transaction) { 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)`), ]) } } |