aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/transaction-activity-log/transaction-activity-log.util.js
diff options
context:
space:
mode:
authorkumavis <kumavis@users.noreply.github.com>2018-10-30 07:49:53 +0800
committerGitHub <noreply@github.com>2018-10-30 07:49:53 +0800
commitad009a4606249649fd54420972fb6a5dd5382fc2 (patch)
tree45f50fb1eca1ad7cb3773446a01ad4867283f365 /ui/app/components/transaction-activity-log/transaction-activity-log.util.js
parentf0602ca354a6d352c13a79a1cba884f54e5b9a83 (diff)
parent18e530221b0f960907d45995c4703b04ed562dc8 (diff)
downloadtangerine-wallet-browser-ad009a4606249649fd54420972fb6a5dd5382fc2.tar
tangerine-wallet-browser-ad009a4606249649fd54420972fb6a5dd5382fc2.tar.gz
tangerine-wallet-browser-ad009a4606249649fd54420972fb6a5dd5382fc2.tar.bz2
tangerine-wallet-browser-ad009a4606249649fd54420972fb6a5dd5382fc2.tar.lz
tangerine-wallet-browser-ad009a4606249649fd54420972fb6a5dd5382fc2.tar.xz
tangerine-wallet-browser-ad009a4606249649fd54420972fb6a5dd5382fc2.tar.zst
tangerine-wallet-browser-ad009a4606249649fd54420972fb6a5dd5382fc2.zip
Merge branch 'develop' into sentry-enhancements2
Diffstat (limited to 'ui/app/components/transaction-activity-log/transaction-activity-log.util.js')
-rw-r--r--ui/app/components/transaction-activity-log/transaction-activity-log.util.js11
1 files changed, 9 insertions, 2 deletions
diff --git a/ui/app/components/transaction-activity-log/transaction-activity-log.util.js b/ui/app/components/transaction-activity-log/transaction-activity-log.util.js
index 97aa9a8f1..16597ae1a 100644
--- a/ui/app/components/transaction-activity-log/transaction-activity-log.util.js
+++ b/ui/app/components/transaction-activity-log/transaction-activity-log.util.js
@@ -18,6 +18,7 @@ const TRANSACTION_SUBMITTED_EVENT = 'transactionSubmitted'
const TRANSACTION_CONFIRMED_EVENT = 'transactionConfirmed'
const TRANSACTION_DROPPED_EVENT = 'transactionDropped'
const TRANSACTION_UPDATED_EVENT = 'transactionUpdated'
+const TRANSACTION_ERRORED_EVENT = 'transactionErrored'
const eventPathsHash = {
[STATUS_PATH]: true,
@@ -39,9 +40,9 @@ function eventCreator (eventKey, timestamp, value) {
}
export function getActivities (transaction) {
- const { history = [] } = transaction
+ const { history = [], txReceipt: { status } = {} } = transaction
- return history.reduce((acc, base) => {
+ const historyActivities = history.reduce((acc, base) => {
// First history item should be transaction creation
if (!Array.isArray(base) && base.status === UNAPPROVED_STATUS && base.txParams) {
const { time, txParams: { value } = {} } = base
@@ -83,4 +84,10 @@ export function getActivities (transaction) {
return acc
}, [])
+
+ // If txReceipt.status is '0x0', that means that an on-chain error occured for the transaction,
+ // so we add an error entry to the Activity Log.
+ return status === '0x0'
+ ? historyActivities.concat(eventCreator(TRANSACTION_ERRORED_EVENT))
+ : historyActivities
}