From 9ebae9f7813d2dcb10398acc02279499f75b32aa Mon Sep 17 00:00:00 2001 From: lukasIO Date: Fri, 26 Jul 2024 13:57:54 +0200 Subject: [PATCH] Rename internal attributesChanged handler and add changeset (#1203) --- .changeset/slimy-islands-work.md | 5 +++++ src/room/Room.ts | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 .changeset/slimy-islands-work.md diff --git a/.changeset/slimy-islands-work.md b/.changeset/slimy-islands-work.md new file mode 100644 index 0000000000..b37f6df85b --- /dev/null +++ b/.changeset/slimy-islands-work.md @@ -0,0 +1,5 @@ +--- +'livekit-client': patch +--- + +Fix RoomEvent.ParticipantAttributesChanged not emitting for local participant (#1200) diff --git a/src/room/Room.ts b/src/room/Room.ts index d9d179292c..2504401b33 100644 --- a/src/room/Room.ts +++ b/src/room/Room.ts @@ -1121,7 +1121,7 @@ class Room extends (EventEmitter as new () => TypedEmitter) this.localParticipant .on(ParticipantEvent.ParticipantMetadataChanged, this.onLocalParticipantMetadataChanged) .on(ParticipantEvent.ParticipantNameChanged, this.onLocalParticipantNameChanged) - .on(ParticipantEvent.AttributesChanged, this.onAttributesChanged) + .on(ParticipantEvent.AttributesChanged, this.onLocalAttributesChanged) .on(ParticipantEvent.TrackMuted, this.onLocalTrackMuted) .on(ParticipantEvent.TrackUnmuted, this.onLocalTrackUnmuted) .on(ParticipantEvent.LocalTrackPublished, this.onLocalTrackPublished) @@ -1300,7 +1300,7 @@ class Room extends (EventEmitter as new () => TypedEmitter) this.localParticipant .off(ParticipantEvent.ParticipantMetadataChanged, this.onLocalParticipantMetadataChanged) .off(ParticipantEvent.ParticipantNameChanged, this.onLocalParticipantNameChanged) - .off(ParticipantEvent.AttributesChanged, this.onAttributesChanged) + .off(ParticipantEvent.AttributesChanged, this.onLocalAttributesChanged) .off(ParticipantEvent.TrackMuted, this.onLocalTrackMuted) .off(ParticipantEvent.TrackUnmuted, this.onLocalTrackUnmuted) .off(ParticipantEvent.LocalTrackPublished, this.onLocalTrackPublished) @@ -1879,7 +1879,7 @@ class Room extends (EventEmitter as new () => TypedEmitter) this.emit(RoomEvent.ParticipantNameChanged, name, this.localParticipant); }; - private onAttributesChanged = (changedAttributes: Record) => { + private onLocalAttributesChanged = (changedAttributes: Record) => { this.emit(RoomEvent.ParticipantAttributesChanged, changedAttributes, this.localParticipant); };