feat: Send uuid to join different events of the same session (#15)

This commit is contained in:
Kevin Szuchet 2023-09-01 14:39:39 +02:00 committed by GitHub
parent 84a92c540a
commit 2189ae528b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,7 @@
import React, { useCallback, useEffect, useState } from 'react'
import { LiveKitRoom } from '@livekit/components-react'
import '@livekit/components-styles'
import { v4 as uuidv4 } from 'uuid'
import { getAnalytics } from 'decentraland-dapps/dist/modules/analytics/utils'
import { Events } from '../../../modules/analytics/types'
import { VideoConference } from '../../VideoConference/'
@ -11,12 +12,14 @@ export default function Conference(props: Props) {
const { token, server, worldName, worldContentServerUrl, loggedInAddress: userAddress } = props
const [alreadyDisconnected, setAlreadyDisconnected] = useState(false)
const analytics = getAnalytics()
const [sessionId] = useState(uuidv4())
const track = useCallback(
(event: Events) => {
if (!worldName || !worldContentServerUrl || !userAddress) return
analytics.track(event, {
uuid: sessionId,
worldName,
worldContentServerUrl,
userAddress