Skip to content

Commit

Permalink
Update to only send track event when route exists
Browse files Browse the repository at this point in the history
  • Loading branch information
jiyounglee committed Oct 17, 2024
1 parent 90bae98 commit 2c8dd17
Showing 1 changed file with 16 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -172,20 +172,22 @@ export function AddFunds({
};

const setSelectedRouteData = (route: RouteData | undefined) => {
track({
userJourney: UserJourney.ADD_FUNDS,
screen: 'InputScreen',
control: 'RoutesMenu',
controlType: 'MenuItem',
extras: {
toTokenAddress: route?.amountData.toToken.address,
toTokenChainId: route?.amountData.toToken.chainId,
fromTokenAddress: route?.amountData.fromToken.address,
fromTokenChainId: route?.amountData.fromToken.chainId,
toAmount: route?.amountData.toAmount,
fromAmount: route?.amountData.fromAmount,
},
});
if (route) {
track({
userJourney: UserJourney.ADD_FUNDS,
screen: 'InputScreen',
control: 'RoutesMenu',
controlType: 'MenuItem',
extras: {
toTokenAddress: route.amountData.toToken.address,
toTokenChainId: route.amountData.toToken.chainId,
fromTokenAddress: route.amountData.fromToken.address,
fromTokenChainId: route.amountData.fromToken.chainId,
toAmount: route.amountData.toAmount,
fromAmount: route.amountData.fromAmount,
},
});
}

addFundsDispatch({
payload: {
Expand Down

0 comments on commit 2c8dd17

Please sign in to comment.