Skip to content

Commit

Permalink
Rename internal attributesChanged handler and add changeset (#1203)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasIO authored Jul 26, 2024
1 parent 00254f3 commit 9ebae9f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/slimy-islands-work.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'livekit-client': patch
---

Fix RoomEvent.ParticipantAttributesChanged not emitting for local participant (#1200)
6 changes: 3 additions & 3 deletions src/room/Room.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1121,7 +1121,7 @@ class Room extends (EventEmitter as new () => TypedEmitter<RoomEventCallbacks>)
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)
Expand Down Expand Up @@ -1300,7 +1300,7 @@ class Room extends (EventEmitter as new () => TypedEmitter<RoomEventCallbacks>)
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)
Expand Down Expand Up @@ -1879,7 +1879,7 @@ class Room extends (EventEmitter as new () => TypedEmitter<RoomEventCallbacks>)
this.emit(RoomEvent.ParticipantNameChanged, name, this.localParticipant);
};

private onAttributesChanged = (changedAttributes: Record<string, string>) => {
private onLocalAttributesChanged = (changedAttributes: Record<string, string>) => {
this.emit(RoomEvent.ParticipantAttributesChanged, changedAttributes, this.localParticipant);
};

Expand Down

0 comments on commit 9ebae9f

Please sign in to comment.