Skip to content

Commit

Permalink
Add profile_modal event
Browse files Browse the repository at this point in the history
  • Loading branch information
olehmell committed Aug 28, 2023
1 parent 7436713 commit e4538db
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/components/auth/ProfileModal/ProfileModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { CommonEvmAddressLinked } from '@/components/auth/CommonModalContent'
import Modal from '@/components/modals/Modal'
import { getLinkedTelegramAccountsQuery } from '@/services/api/notifications/query'
import { getAccountDataQuery } from '@/services/subsocial/evmAddresses'
import { useSendEvent } from '@/stores/analytics'
import { cx } from '@/utils/class-names'
import React, { useEffect, useState } from 'react'
import AboutContent from './contents/AboutContent'
Expand Down Expand Up @@ -46,11 +47,15 @@ export default function ProfileModal({
step || 'account'
)
const { data: accountData } = getAccountDataQuery.useQuery(address)
const sendEvent = useSendEvent()

const { evmAddress: linkedEvmAddress } = accountData || {}

useEffect(() => {
if (props.isOpen) setCurrentState(step || 'account')
if (props.isOpen) {
sendEvent('open_profile_modal')
setCurrentState(step || 'account')
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [props.isOpen])

Expand Down

0 comments on commit e4538db

Please sign in to comment.