Skip to content

Commit

Permalink
feat: add missing select token and chain events
Browse files Browse the repository at this point in the history
  • Loading branch information
juanmahidalgo committed Nov 23, 2023
1 parent 74fe0de commit 488d509
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -815,6 +815,9 @@ export const BuyWithCryptoModal = (props: Props) => {
setRoute(undefined)
setRouteFailed(false)
abortControllerRef.current = new AbortController()
analytics.track(events.CROSS_CHAIN_TOKEN_SELECTION, {
selectedToken
})
} else {
setSelectedChain(Number(selectedOption.chainId) as ChainId)
const manaDestinyChain = providerTokens.find(
Expand All @@ -827,9 +830,13 @@ export const BuyWithCryptoModal = (props: Props) => {
)
setRoute(undefined)
setRouteFailed(false)

analytics.track(events.CROSS_CHAIN_CHAIN_SELECTION, {
selectedChain
})
}
},
[providerTokens, selectedChain]
[analytics, providerTokens, selectedChain]
)

const renderModalNavigation = useCallback(() => {
Expand Down
2 changes: 2 additions & 0 deletions webapp/src/utils/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,6 @@ export const SEARCH_ALL = 'Search all results'

// Buy Cross-chain
export const BUY_ITEM_CROSS_CHAIN = 'Buy Item Cross Chain'
export const CROSS_CHAIN_TOKEN_SELECTION = 'Cross Chain token selection'
export const CROSS_CHAIN_CHAIN_SELECTION = 'Cross Chain chain selection'
export const ERROR_GETTING_ROUTE = 'Error getting Route'

0 comments on commit 488d509

Please sign in to comment.