mirror of https://github.com/OpenVidu/openvidu.git
ov-components: Update participant name handling in Session and Toolbar components
parent
e1f16a6179
commit
57e76fe69b
|
@ -290,7 +290,8 @@ export class SessionComponent implements OnInit, OnDestroy {
|
|||
await this.openviduService.disconnectRoom(() => {
|
||||
this.onParticipantLeft.emit({
|
||||
roomName: this.openviduService.getRoomName(),
|
||||
participantName: this.participantService.getLocalParticipant()?.identity || '',
|
||||
participantName: this.participantService.getLocalParticipant()?.name || '',
|
||||
identity: this.participantService.getLocalParticipant()?.identity || '',
|
||||
reason
|
||||
});
|
||||
}, false);
|
||||
|
@ -447,7 +448,7 @@ export class SessionComponent implements OnInit, OnDestroy {
|
|||
this.log.d(`Data event received: ${topic}`);
|
||||
switch (topic) {
|
||||
case DataTopic.CHAT:
|
||||
const participantName = participant?.identity || 'Unknown';
|
||||
const participantName = participant?.name || 'Unknown';
|
||||
this.chatService.addRemoteMessage(event.message, participantName);
|
||||
break;
|
||||
case DataTopic.RECORDING_STARTING:
|
||||
|
@ -537,7 +538,8 @@ export class SessionComponent implements OnInit, OnDestroy {
|
|||
this.actionService.closeConnectionDialog();
|
||||
const participantLeftEvent: ParticipantLeftEvent = {
|
||||
roomName: this.openviduService.getRoomName(),
|
||||
participantName: this.participantService.getLocalParticipant()?.identity || '',
|
||||
participantName: this.participantService.getLocalParticipant()?.name || '',
|
||||
identity: this.participantService.getLocalParticipant()?.identity || '',
|
||||
reason: ParticipantLeftReason.NETWORK_DISCONNECT
|
||||
};
|
||||
const messageErrorKey = 'ERRORS.DISCONNECT';
|
||||
|
|
|
@ -558,7 +558,8 @@ export class ToolbarComponent implements OnInit, OnDestroy, AfterViewInit {
|
|||
await this.openviduService.disconnectRoom(() => {
|
||||
this.onParticipantLeft.emit({
|
||||
roomName: this.openviduService.getRoomName(),
|
||||
participantName: this.participantService.getLocalParticipant()?.identity || '',
|
||||
participantName: this.participantService.getLocalParticipant()?.name || '',
|
||||
identity: this.participantService.getLocalParticipant()?.identity || '',
|
||||
reason: ParticipantLeftReason.LEAVE
|
||||
});
|
||||
this.onRoomDisconnected.emit();
|
||||
|
|
|
@ -18,6 +18,7 @@ import {
|
|||
export interface ParticipantLeftEvent {
|
||||
roomName: string;
|
||||
participantName: string;
|
||||
identity: string;
|
||||
reason: ParticipantLeftReason;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue