diff --git a/src/components/video/index.ts b/src/components/video/index.ts index 63d68bba..e93241a9 100644 --- a/src/components/video/index.ts +++ b/src/components/video/index.ts @@ -534,6 +534,32 @@ export class VideoConference extends BaseComponent { const newParticipantName = participant.name.trim(); + if (this.videoConfig.canUseDefaultAvatars) { + this.roomState.updateMyProperties({ + avatar: participant.avatar, + name: participant.name, + type: participant.type, + joinedMeeting: true, + }); + + localParticipant.publish({ + ...localParticipant.value, + avatar: participant.avatar, + name: participant.name, + }); + + participants.publish({ + ...participants.value, + [participant.id]: { + ...participants.value[participant.id], + avatar: participant.avatar, + name: participant.name, + }, + }); + + return; + } + localParticipant.publish({ ...localParticipant.value, name: newParticipantName, @@ -542,22 +568,11 @@ export class VideoConference extends BaseComponent { participants.publish({ ...participants.value, [participant.id]: { - ...localParticipant.value, + ...participants.value[participant.id], name: newParticipantName, }, }); - if (this.videoConfig.canUseDefaultAvatars) { - this.roomState.updateMyProperties({ - avatar: participant.avatar, - name: participant.name, - type: participant.type, - joinedMeeting: true, - }); - - return; - } - this.roomState.updateMyProperties({ name: participant.name, type: participant.type,