From ab74818579f52dcf66f756cfdb3d92da63a5eb63 Mon Sep 17 00:00:00 2001 From: csantosm <4a.santos@gmail.com> Date: Thu, 10 Mar 2022 12:59:55 +0100 Subject: [PATCH] openvidu-components: Fixd bug updating participants array in part. panel --- .../participants-panel/participants-panel.component.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/openvidu-components-angular/projects/openvidu-angular/src/lib/components/panel/participants-panel/participants-panel/participants-panel.component.ts b/openvidu-components-angular/projects/openvidu-angular/src/lib/components/panel/participants-panel/participants-panel/participants-panel.component.ts index 096652f1..3b59a3e9 100644 --- a/openvidu-components-angular/projects/openvidu-angular/src/lib/components/panel/participants-panel/participants-panel/participants-panel.component.ts +++ b/openvidu-components-angular/projects/openvidu-angular/src/lib/components/panel/participants-panel/participants-panel/participants-panel.component.ts @@ -47,9 +47,11 @@ export class ParticipantsPanelComponent implements OnInit, OnDestroy { this.remoteParticipantsSubs = this.participantService.remoteParticipantsObs.subscribe((p: ParticipantAbstractModel[]) => { // Workaround which forc the objects references update // After one entirely day trying to make it works, this is the only way - p.forEach((par, index) => { - this.remoteParticipants[index] = Object.create(par); + const remoteParticipantsAux = []; + p.forEach((par) => { + remoteParticipantsAux.push(Object.create(par)); }); + this.remoteParticipants = remoteParticipantsAux; // Mark for re-rendering using an impure pipe 'streamsTypesEnabled' this.cd.markForCheck(); });