mirror of
https://github.com/suitenumerique/meet.git
synced 2026-07-26 11:58:53 +00:00
⚡️(frontend) narrow chat participant list update events
Reduce the set of events that trigger an update of the participant list in the chat, keeping only those relevant to display: attribute and name changes. This avoids unnecessary re-renders when other, unrelated participant events fire.
This commit is contained in:
committed by
aleb_the_flash
parent
fb3a54a224
commit
acb583b14f
@@ -76,7 +76,13 @@ export function Chat({ ...props }: ChatProps) {
|
||||
})
|
||||
|
||||
// Use useParticipants hook to trigger a re-render when the participant list changes.
|
||||
const participants = useParticipants()
|
||||
const participants = useParticipants({
|
||||
updateOnlyOn: [
|
||||
RoomEvent.ParticipantAttributesChanged,
|
||||
RoomEvent.ParticipantNameChanged,
|
||||
RoomEvent.ParticipantMetadataChanged,
|
||||
],
|
||||
})
|
||||
|
||||
const lastReadMsgAt = React.useRef<ChatMessage['timestamp']>(0)
|
||||
const previousMessageCount = React.useRef(0)
|
||||
|
||||
Reference in New Issue
Block a user