From 998382020d5b20116314b461f2f2345ac0f5e550 Mon Sep 17 00:00:00 2001 From: lebaudantoine Date: Mon, 14 Oct 2024 17:14:18 +0200 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F(frontend)=20refactor=20backp?= =?UTF-8?q?orted=20LiveKit=20sources?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Backported changes to LiveKit sources, eliminating the need to listen for specific Participant events. --- .../controls/Participants/ParticipantsList.tsx | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/frontend/src/features/rooms/livekit/components/controls/Participants/ParticipantsList.tsx b/src/frontend/src/features/rooms/livekit/components/controls/Participants/ParticipantsList.tsx index 4c74c22e..c1f5cc9d 100644 --- a/src/frontend/src/features/rooms/livekit/components/controls/Participants/ParticipantsList.tsx +++ b/src/frontend/src/features/rooms/livekit/components/controls/Participants/ParticipantsList.tsx @@ -1,5 +1,4 @@ import { css } from '@/styled-system/css' -import { allParticipantRoomEvents } from '@livekit/components-core' import { useParticipants } from '@livekit/components-react' import { Div, H } from '@/primitives' @@ -8,7 +7,6 @@ import { ParticipantListItem } from '../../controls/Participants/ParticipantList import { ParticipantsCollapsableList } from '../../controls/Participants/ParticipantsCollapsableList' import { HandRaisedListItem } from '../../controls/Participants/HandRaisedListItem' import { LowerAllHandsButton } from '../../controls/Participants/LowerAllHandsButton' -import { RoomEvent } from 'livekit-client' // TODO: Optimize rendering performance, especially for longer participant lists, even though they are generally short. export const ParticipantsList = () => { @@ -17,12 +15,7 @@ export const ParticipantsList = () => { // Preferred using the 'useParticipants' hook rather than the separate remote and local hooks, // because the 'useLocalParticipant' hook does not update the participant's information when their // metadata/name changes. The LiveKit team has marked this as a TODO item in the code. - const participants = useParticipants({ - updateOnlyOn: [ - RoomEvent.ParticipantNameChanged, - ...allParticipantRoomEvents, - ], - }) + const participants = useParticipants() const sortedRemoteParticipants = participants .slice(1)