fix: Send user address in the track events

This commit is contained in:
Kevin Szuchet 2023-08-21 12:43:24 +02:00
parent 02f1a6df5b
commit 580800457e
No known key found for this signature in database
GPG Key ID: 1E083BC33700E594

View File

@ -8,20 +8,21 @@ import { Props } from './Conference.types'
import './Conference.css'
export default function Conference(props: Props) {
const { token, server, worldName, worldContentServerUrl } = props
const { token, server, worldName, worldContentServerUrl, loggedInAddress: userAddress } = props
const [alreadyDisconnected, setAlreadyDisconnected] = useState(false)
const analytics = getAnalytics()
const track = useCallback(
(event: Events) => {
if (!worldName || !worldContentServerUrl) return
if (!worldName || !worldContentServerUrl || !userAddress) return
analytics.track(event, {
worldName,
worldContentServerUrl
worldContentServerUrl,
userAddress
})
},
[worldName, worldContentServerUrl]
[worldName, worldContentServerUrl, userAddress]
)
const handleConnect = useCallback(() => track(Events.CONNECT), [track])