Skip to content

Commit

Permalink
fix: Adjust safe creation event to include safeAddress
Browse files Browse the repository at this point in the history
  • Loading branch information
usame-algan committed Oct 18, 2023
1 parent 8189cd7 commit ae61073
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { updateAddressBook } from '@/components/new-safe/create/logic/address-bo
import { useAppDispatch } from '@/store'
import useChainId from '@/hooks/useChainId'
import { usePendingSafe } from './usePendingSafe'
import { gtmSetSafeAddress } from '@/services/analytics/gtm'

const useSafeCreationEffects = ({
status,
Expand Down Expand Up @@ -74,6 +75,7 @@ const useSafeCreationEffects = ({
// Tracking
useEffect(() => {
if (status === SafeCreationStatus.SUCCESS) {
pendingSafe?.safeAddress && gtmSetSafeAddress(pendingSafe.safeAddress)
trackEvent(CREATE_SAFE_EVENTS.CREATED_SAFE)
return
}
Expand All @@ -82,7 +84,7 @@ const useSafeCreationEffects = ({
trackEvent(CREATE_SAFE_EVENTS.REJECT_CREATE_SAFE)
return
}
}, [status])
}, [pendingSafe?.safeAddress, status])
}

export default useSafeCreationEffects

0 comments on commit ae61073

Please sign in to comment.