ov-components: simplify disconnect logic by removing callback. The participantLeft event will be fired by LK event handler

master
Carlos Santos 2025-05-14 13:48:42 +02:00
parent 94f2e3e573
commit bd711b57f3
1 changed files with 1 additions and 7 deletions

View File

@ -518,13 +518,7 @@ export class ToolbarComponent implements OnInit, OnDestroy, AfterViewInit {
*/ */
async disconnect() { async disconnect() {
try { try {
await this.openviduService.disconnectRoom(() => await this.openviduService.disconnectRoom();
this.onParticipantLeft.emit({
roomName: this.openviduService.getRoomName(),
participantName: this.participantService.getLocalParticipant()?.identity || '',
reason: ParticipantLeftReason.LEAVE
})
);
} catch (error) { } catch (error) {
this.log.e('There was an error disconnecting:', error.code, error.message); this.log.e('There was an error disconnecting:', error.code, error.message);
this.actionService.openDialog(this.translateService.translate('ERRORS.DISCONNECT'), error?.error || error?.message || error); this.actionService.openDialog(this.translateService.translate('ERRORS.DISCONNECT'), error?.error || error?.message || error);