Skip to content

Commit

Permalink
fix: [Analytics] Set safe address during safe creation (#3360)
Browse files Browse the repository at this point in the history
  • Loading branch information
usame-algan authored Feb 28, 2024
1 parent bb29b74 commit 6961b9b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/components/new-safe/create/steps/ReviewStep/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import useWalletCanPay from '@/hooks/useWalletCanPay'
import useWallet from '@/hooks/wallets/useWallet'
import { useWeb3 } from '@/hooks/wallets/web3'
import { CREATE_SAFE_CATEGORY, CREATE_SAFE_EVENTS, OVERVIEW_EVENTS, trackEvent } from '@/services/analytics'
import { gtmSetSafeAddress } from '@/services/analytics/gtm'
import { getReadOnlyFallbackHandlerContract } from '@/services/contracts/safeContracts'
import { isSocialLoginWallet } from '@/services/mpc/SocialLoginModule'
import { useAppDispatch } from '@/store'
Expand Down Expand Up @@ -212,6 +213,8 @@ const ReviewStep = ({ data, onSubmit, onBack, setStep }: StepRenderProps<NewSafe
const safeAddress = await computeNewSafeAddress(provider, { ...props, saltNonce })

if (isCounterfactual && payMethod === PayMethod.PayLater) {
gtmSetSafeAddress(safeAddress)

trackEvent({ ...OVERVIEW_EVENTS.PROCEED_WITH_TX, label: 'counterfactual', category: CREATE_SAFE_CATEGORY })
await createCounterfactualSafe(chain, safeAddress, saltNonce, data, dispatch, props, router)
trackEvent({ ...CREATE_SAFE_EVENTS.CREATED_SAFE, label: 'counterfactual' })
Expand Down

0 comments on commit 6961b9b

Please sign in to comment.