From 3bb13907c23ccc2d5f3bc569b3beeaa44364c098 Mon Sep 17 00:00:00 2001 From: Dorra Jaouad Date: Tue, 25 Aug 2026 13:32:50 +0200 Subject: [PATCH] fix(CallView): sharedDatas is populated later than callParticipantModels so accomodate watchers with this order Signed-off-by: Dorra Jaouad --- src/components/CallView/CallView.vue | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/components/CallView/CallView.vue b/src/components/CallView/CallView.vue index fc1e52809c7..4869254b26c 100644 --- a/src/components/CallView/CallView.vue +++ b/src/components/CallView/CallView.vue @@ -320,7 +320,10 @@ export default { // A single active speaker keeps the main area for itself, rather // than being the only tile of the speakers grid ?? (this.showSpeakers ? this.promotedSpeakerModels[0] : undefined) - ?? this.callParticipantModels.find((callParticipantModel) => this.sharedDatas[callParticipantModel.attributes.peerId].promoted) + // The shared data of a model is set from a watcher, so it may not + // be there yet when this is evaluated right after the model was + // added + ?? this.callParticipantModels.find((callParticipantModel) => this.sharedDatas[callParticipantModel.attributes.peerId]?.promoted) ?? this.callParticipantModels[0] }, @@ -596,7 +599,7 @@ export default { promotedAreaSessionIds(sessionIds, previousSessionIds) { // Runs before the grids are re-rendered, while the tiles are still // where they are about to move from - animateTilePromotion(sessionIds, previousSessionIds) + animateTilePromotion(sessionIds, previousSessionIds ?? []) }, speakers: { @@ -987,7 +990,7 @@ export default { // bad specially with a low number of participants. if (this.isGrid) { callParticipantModel.setSimulcastVideoQuality(SIMULCAST.MEDIUM, SIMULCAST.HIGH) - } else if (this.sharedDatas[callParticipantModel.attributes.peerId].promoted + } else if (this.sharedDatas[callParticipantModel.attributes.peerId]?.promoted || this.selectedVideoPeerId === callParticipantModel.attributes.peerId || this.promotedSpeakerPeerIds.has(callParticipantModel.attributes.peerId)) { callParticipantModel.setSimulcastVideoQuality(SIMULCAST.HIGH, SIMULCAST.HIGH)