Fix mixpanel event for Swap dapp (#3094)

fix mixpanel event for swap
This commit is contained in:
Max Alekseenko
2025-11-03 18:07:34 +01:00
committed by GitHub
parent 6c27697666
commit 01941f6b02
+2 -6
View File
@@ -96,7 +96,7 @@ const Swap = () => {
useEffect(() => {
const onRouteExecutionUpdated = async(update: RouteExecutionUpdate) => {
try {
if (!eventParams.current.activityToken || eventParams.current.routeId !== update.route.id) {
if (eventParams.current.routeId !== update.route.id) {
const { chainId, from, to } = update.route.steps.at(-1)?.transactionRequest ?? {};
if (chainId && from && to) {
const response = await trackTransaction(from, to, String(chainId));
@@ -107,11 +107,7 @@ const Swap = () => {
chainId: String(chainId),
};
}
} else if (
[ 'SWAP', 'CROSS_CHAIN' ].includes(update.process.type) &&
eventParams.current.routeId === update.route.id &&
update.process.txHash
) {
} else if ([ 'SWAP', 'CROSS_CHAIN' ].includes(update.process.type) && update.process.txHash) {
mixpanel.logEvent(mixpanel.EventTypes.WALLET_ACTION, {
Action: 'Send Transaction',
Address: eventParams.current.from,