From a4fffdfbfb6fa91dba90438847c3f36d628fca4b Mon Sep 17 00:00:00 2001 From: Jamie Kyle <113370520+jamiebuilds-signal@users.noreply.github.com> Date: Wed, 30 Aug 2023 14:34:58 -0700 Subject: [PATCH] Fix speaker view not auto switching on presenting --- ts/components/CallScreen.stories.tsx | 3 +++ ts/components/CallingParticipantsList.stories.tsx | 1 + ts/components/GroupCallOverflowArea.stories.tsx | 2 ++ ts/components/GroupCallRemoteParticipant.stories.tsx | 1 + ts/state/smart/CallManager.tsx | 1 + ts/types/Calling.ts | 3 ++- 6 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ts/components/CallScreen.stories.tsx b/ts/components/CallScreen.stories.tsx index d65c45c5680d..1af74d0cc90f 100644 --- a/ts/components/CallScreen.stories.tsx +++ b/ts/components/CallScreen.stories.tsx @@ -304,6 +304,7 @@ export function GroupCall1(): JSX.Element { callMode: CallMode.Group, remoteParticipants: [ { + aci: generateAci(), demuxId: 0, hasRemoteAudio: true, hasRemoteVideo: true, @@ -328,6 +329,7 @@ GroupCall1.story = { // We generate these upfront so that the list is stable when you move the slider. const allRemoteParticipants = times(MAX_PARTICIPANTS).map(index => ({ + aci: generateAci(), demuxId: index, hasRemoteAudio: index % 3 !== 0, hasRemoteVideo: index % 4 !== 0, @@ -371,6 +373,7 @@ export function GroupCallReconnecting(): JSX.Element { connectionState: GroupCallConnectionState.Reconnecting, remoteParticipants: [ { + aci: generateAci(), demuxId: 0, hasRemoteAudio: true, hasRemoteVideo: true, diff --git a/ts/components/CallingParticipantsList.stories.tsx b/ts/components/CallingParticipantsList.stories.tsx index 07cc512d26ab..683932523346 100644 --- a/ts/components/CallingParticipantsList.stories.tsx +++ b/ts/components/CallingParticipantsList.stories.tsx @@ -20,6 +20,7 @@ function createParticipant( participantProps: Partial ): GroupCallRemoteParticipantType { return { + aci: generateAci(), demuxId: 2, hasRemoteAudio: Boolean(participantProps.hasRemoteAudio), hasRemoteVideo: Boolean(participantProps.hasRemoteVideo), diff --git a/ts/components/GroupCallOverflowArea.stories.tsx b/ts/components/GroupCallOverflowArea.stories.tsx index 79927e3a67a5..1bd1272cd5db 100644 --- a/ts/components/GroupCallOverflowArea.stories.tsx +++ b/ts/components/GroupCallOverflowArea.stories.tsx @@ -12,12 +12,14 @@ import { getDefaultConversationWithServiceId } from '../test-both/helpers/getDef import { fakeGetGroupCallVideoFrameSource } from '../test-both/helpers/fakeGetGroupCallVideoFrameSource'; import { FRAME_BUFFER_SIZE } from '../calling/constants'; import enMessages from '../../_locales/en/messages.json'; +import { generateAci } from '../types/ServiceId'; const MAX_PARTICIPANTS = 32; const i18n = setupI18n('en', enMessages); const allRemoteParticipants = times(MAX_PARTICIPANTS).map(index => ({ + aci: generateAci(), demuxId: index, hasRemoteAudio: index % 3 !== 0, hasRemoteVideo: index % 4 !== 0, diff --git a/ts/components/GroupCallRemoteParticipant.stories.tsx b/ts/components/GroupCallRemoteParticipant.stories.tsx index 1abd6b4621ca..5d7cc94ef726 100644 --- a/ts/components/GroupCallRemoteParticipant.stories.tsx +++ b/ts/components/GroupCallRemoteParticipant.stories.tsx @@ -51,6 +51,7 @@ const createProps = ( i18n, audioLevel: 0, remoteParticipant: { + aci: generateAci(), demuxId: 123, hasRemoteAudio, hasRemoteVideo: true, diff --git a/ts/state/smart/CallManager.tsx b/ts/state/smart/CallManager.tsx index f46d0c5aa337..df12e220a4f6 100644 --- a/ts/state/smart/CallManager.tsx +++ b/ts/state/smart/CallManager.tsx @@ -229,6 +229,7 @@ const mapStateToActiveCallProp = ( remoteParticipants.push({ ...remoteConversation, + aci: remoteParticipant.aci, demuxId: remoteParticipant.demuxId, hasRemoteAudio: remoteParticipant.hasRemoteAudio, hasRemoteVideo: remoteParticipant.hasRemoteVideo, diff --git a/ts/types/Calling.ts b/ts/types/Calling.ts index dd680b732cbe..ececa6425cd5 100644 --- a/ts/types/Calling.ts +++ b/ts/types/Calling.ts @@ -3,7 +3,7 @@ import type { AudioDevice } from '@signalapp/ringrtc'; import type { ConversationType } from '../state/ducks/conversations'; -import type { ServiceIdString } from './ServiceId'; +import type { AciString, ServiceIdString } from './ServiceId'; // These are strings (1) for the database (2) for Storybook. export enum CallMode { @@ -135,6 +135,7 @@ export enum GroupCallJoinState { } export type GroupCallRemoteParticipantType = ConversationType & { + aci: AciString; demuxId: number; hasRemoteAudio: boolean; hasRemoteVideo: boolean;