diff options
author | Chi Kei Chan <chikeichan@gmail.com> | 2018-01-20 07:29:36 +0800 |
---|---|---|
committer | Chi Kei Chan <chikeichan@gmail.com> | 2018-01-20 07:29:36 +0800 |
commit | 77c545336b38aefc6105cde1799b18066df8bef9 (patch) | |
tree | 121a140131c8cb1f4b746d8f37d4a403b0910aad /ui/app/components/transaction-list-item.js | |
parent | 98b5a62fa74aa6730a25df28dfe5032cfb487697 (diff) | |
parent | 4e63924e607a07f94ff0a741a036ab352b0b7a3f (diff) | |
download | dexon-wallet-77c545336b38aefc6105cde1799b18066df8bef9.tar.gz dexon-wallet-77c545336b38aefc6105cde1799b18066df8bef9.tar.zst dexon-wallet-77c545336b38aefc6105cde1799b18066df8bef9.zip |
Merge branch 'uat' into newmaster
Diffstat (limited to 'ui/app/components/transaction-list-item.js')
-rw-r--r-- | ui/app/components/transaction-list-item.js | 54 |
1 files changed, 30 insertions, 24 deletions
diff --git a/ui/app/components/transaction-list-item.js b/ui/app/components/transaction-list-item.js index 42ef665b..4e3d2cb9 100644 --- a/ui/app/components/transaction-list-item.js +++ b/ui/app/components/transaction-list-item.js @@ -199,34 +199,40 @@ function formatDate (date) { } function renderErrorOrWarning (transaction) { - const { status, err, warning } = transaction + const { status } = transaction // show rejected if (status === 'rejected') { return h('span.error', ' (Rejected)') } - - // 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.warning`, ` (Warning)`), - ]) + if (transaction.err || transaction.warning) { + const { err, warning = {} } = transaction + const errFirst = !!((err && warning) || err) + + 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.warning`, ` (Warning)`), + ]) + } } } |