Skip to content

Commit

Permalink
refactor: transaction/metrics condense switch cases
Browse files Browse the repository at this point in the history
  • Loading branch information
digiwand committed Oct 30, 2024
1 parent 2c86162 commit 19f43c0
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions app/scripts/lib/transaction/metrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -642,25 +642,14 @@ function updateTransactionEventFragment({

switch (eventName) {
case TransactionMetaMetricsEvent.approved:
transactionMetricsRequest.updateEventFragment(uniqueId, {
properties: payload.properties,
sensitiveProperties: payload.sensitiveProperties,
});
break;

case TransactionMetaMetricsEvent.rejected:
transactionMetricsRequest.updateEventFragment(uniqueId, {
properties: payload.properties,
sensitiveProperties: payload.sensitiveProperties,
});
break;

case TransactionMetaMetricsEvent.finalized:
transactionMetricsRequest.updateEventFragment(uniqueId, {
properties: payload.properties,
sensitiveProperties: payload.sensitiveProperties,
});
break;

default:
break;
}
Expand All @@ -679,6 +668,7 @@ function finalizeTransactionEventFragment({

switch (eventName) {
case TransactionMetaMetricsEvent.approved:
case TransactionMetaMetricsEvent.finalized:
transactionMetricsRequest.finalizeEventFragment(uniqueId);
break;

Expand All @@ -688,9 +678,6 @@ function finalizeTransactionEventFragment({
});
break;

case TransactionMetaMetricsEvent.finalized:
transactionMetricsRequest.finalizeEventFragment(uniqueId);
break;
default:
break;
}
Expand Down

0 comments on commit 19f43c0

Please sign in to comment.