Skip to content

Commit

Permalink
[NO CHANGELOG] [Add Tokens Widget] Add trackFlow with messageId (#2441)
Browse files Browse the repository at this point in the history
  • Loading branch information
jiyounglee authored Dec 2, 2024
1 parent 8657c3f commit d5f6d2a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import {
import { Web3Provider } from '@ethersproject/providers';
import { useTranslation } from 'react-i18next';
import { ActionType } from '@0xsquid/squid-types';
import { trackError } from '@imtbl/metrics';
import { trackFlow } from '@imtbl/metrics';
import { SimpleLayout } from '../../../components/SimpleLayout/SimpleLayout';
import { EventTargetContext } from '../../../context/event-target-context/EventTargetContext';
import {
Expand Down Expand Up @@ -270,8 +270,8 @@ export function AddTokens({
toTokenAddress,
geoBlocked: !isSwapAvailable,
},
}).catch((err) => {
trackError('commerce', 'addTokensLoaded', err);
}).then((ctx) => {
trackFlow('commerce', `addTokensLoaded_${ctx.event.messageId}`);
});
}, [id, isSwapAvailable]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { t } from 'i18next';
import { Trans } from 'react-i18next';
import { Environment } from '@imtbl/config';
import { ChainId } from '@imtbl/checkout-sdk';
import { trackError } from '@imtbl/metrics';
import { trackFlow } from '@imtbl/metrics';
import { SimpleLayout } from '../../../components/SimpleLayout/SimpleLayout';
import { AddTokensContext } from '../context/AddTokensContext';
import { useRoutes } from '../hooks/useRoutes';
Expand Down Expand Up @@ -400,8 +400,8 @@ export function Review({
fromTokenSymbol: amountData?.fromToken.symbol,
toTokenSymbol: amountData?.toToken.symbol,
},
}).catch((err) => {
trackError('commerce', 'addTokensFundsAdded', err);
}).then((ctx) => {
trackFlow('commerce', `addTokensFundsAdded_${ctx.event.messageId}`);
});

sendAddTokensSuccessEvent(eventTarget, executeTxnReceipt.transactionHash);
Expand Down

0 comments on commit d5f6d2a

Please sign in to comment.