Skip to content

Commit

Permalink
Fix E2E tests
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewwalsh0 committed Mar 28, 2024
1 parent 89c2996 commit c5d4af0
Showing 1 changed file with 15 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,6 @@ export function useSimulationMetrics({

useIncompleteAssetEvent(balanceChanges, displayNamesByAddress);

// Skip metrics if simulation disabled or chain not supported.
if (
[
SimulationErrorCode.ChainNotSupported,
SimulationErrorCode.Disabled,
].includes(simulationData?.error?.code as SimulationErrorCode)
) {
return;
}

const receivingAssets = balanceChanges.filter(
(change) => !change.amount.isNegative,
);
Expand Down Expand Up @@ -123,9 +113,23 @@ export function useSimulationMetrics({

const params = { properties, sensitiveProperties };

const shouldSkipMetrics = [
SimulationErrorCode.ChainNotSupported,
SimulationErrorCode.Disabled,
].includes(simulationData?.error?.code as SimulationErrorCode);

useEffect(() => {
if (shouldSkipMetrics) {
return;
}

updateTransactionEventFragment(params, transactionId);
}, [transactionId, JSON.stringify(params)]);
}, [
shouldSkipMetrics,
updateTransactionEventFragment,
transactionId,
JSON.stringify(params),
]);
}

function useIncompleteAssetEvent(
Expand Down

0 comments on commit c5d4af0

Please sign in to comment.