From 7b6ad345aead9e37af9f1c01b13b003b4d24e48a Mon Sep 17 00:00:00 2001 From: Evan Hahn <69474926+EvanHahn-Signal@users.noreply.github.com> Date: Mon, 23 Nov 2020 11:31:58 -0600 Subject: [PATCH] Group calling: disable local camera when call disconnects --- ts/services/calling.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ts/services/calling.ts b/ts/services/calling.ts index 9cd546d2cd..20d48b0bce 100644 --- a/ts/services/calling.ts +++ b/ts/services/calling.ts @@ -390,14 +390,16 @@ export class CallingClass { if ( localDeviceState.connectionState === ConnectionState.NotConnected ) { - if (localDeviceState.videoMuted) { - this.disableLocalCamera(); - } + // NOTE: This assumes that only one call is active at a time. For example, if + // there are two calls using the camera, this will disable both of them. + // That's fine for now, but this will break if that assumption changes. + this.disableLocalCamera(); delete this.callsByConversation[conversationId]; } else { this.callsByConversation[conversationId] = groupCall; + // NOTE: This assumes only one active call at a time. See comment above. if (localDeviceState.videoMuted) { this.disableLocalCamera(); } else {