Merge pull request #5 from Uniswap/geocheck-analytics
feat: add analytics for moonpay ip check
This commit is contained in:
commit
3e0788092e
@ -1,3 +1,4 @@
|
|||||||
|
import { sendAnalyticsEvent } from '@uniswap/analytics'
|
||||||
import { DEFAULT_TXN_DISMISS_MS } from 'constants/misc'
|
import { DEFAULT_TXN_DISMISS_MS } from 'constants/misc'
|
||||||
import { useCallback, useEffect, useMemo, useState } from 'react'
|
import { useCallback, useEffect, useMemo, useState } from 'react'
|
||||||
import { useAppDispatch, useAppSelector } from 'state/hooks'
|
import { useAppDispatch, useAppSelector } from 'state/hooks'
|
||||||
@ -51,6 +52,7 @@ export function useFiatOnrampAvailability(shouldCheck: boolean, callback?: () =>
|
|||||||
setLoading(true)
|
setLoading(true)
|
||||||
try {
|
try {
|
||||||
const result = await getMoonpayAvailability()
|
const result = await getMoonpayAvailability()
|
||||||
|
sendAnalyticsEvent('MoonPay Geochecker', { success: result })
|
||||||
if (stale) return
|
if (stale) return
|
||||||
dispatch(setFiatOnrampAvailability(result))
|
dispatch(setFiatOnrampAvailability(result))
|
||||||
if (result && callback) {
|
if (result && callback) {
|
||||||
|
Loading…
Reference in New Issue
Block a user