aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/transaction-activity-log/transaction-activity-log.util.js
diff options
context:
space:
mode:
authorAlexander Tseung <alextsg@users.noreply.github.com>2018-10-23 19:59:04 +0800
committerGitHub <noreply@github.com>2018-10-23 19:59:04 +0800
commit7852269ed156787eb279e0b55d643c4c13c04020 (patch)
tree01396e0b6b86aa3152c6f1e7ed7ea7267efd0aff /ui/app/components/transaction-activity-log/transaction-activity-log.util.js
parent7b739f9be866a900ef51f2dba80f2fa9e636fe15 (diff)
downloadtangerine-wallet-browser-7852269ed156787eb279e0b55d643c4c13c04020.tar
tangerine-wallet-browser-7852269ed156787eb279e0b55d643c4c13c04020.tar.gz
tangerine-wallet-browser-7852269ed156787eb279e0b55d643c4c13c04020.tar.bz2
tangerine-wallet-browser-7852269ed156787eb279e0b55d643c4c13c04020.tar.lz
tangerine-wallet-browser-7852269ed156787eb279e0b55d643c4c13c04020.tar.xz
tangerine-wallet-browser-7852269ed156787eb279e0b55d643c4c13c04020.tar.zst
tangerine-wallet-browser-7852269ed156787eb279e0b55d643c4c13c04020.zip
Add Activity Log entry for onchain failures for a transaction. Change scrolling of the transaction list. Remove Transaction Details modal. (#5581)
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
}