diff --git a/ts/components/CallManager.stories.tsx b/ts/components/CallManager.stories.tsx index 49ece66acf..c036187e0c 100644 --- a/ts/components/CallManager.stories.tsx +++ b/ts/components/CallManager.stories.tsx @@ -116,6 +116,7 @@ const createProps = (storyProps: Partial = {}): PropsType => ({ ), toggleSettings: action('toggle-settings'), toggleSpeakerView: action('toggle-speaker-view'), + isConversationTooBigToRing: false, }); export default { diff --git a/ts/components/CallManager.tsx b/ts/components/CallManager.tsx index 6c750bedf1..e73cfa162b 100644 --- a/ts/components/CallManager.tsx +++ b/ts/components/CallManager.tsx @@ -41,7 +41,6 @@ import type { } from '../state/ducks/calling'; import type { LocalizerType, ThemeType } from '../types/Util'; import { missingCaseError } from '../util/missingCaseError'; -import { isConversationTooBigToRing } from '../conversations/isConversationTooBigToRing'; const GROUP_CALL_RING_DURATION = 60 * 1000; @@ -100,6 +99,7 @@ export type PropsType = { toggleScreenRecordingPermissionsDialog: () => unknown; toggleSettings: () => void; toggleSpeakerView: () => void; + isConversationTooBigToRing: boolean; }; type ActiveCallManagerPropsType = PropsType & { @@ -455,10 +455,13 @@ export function CallManager(props: PropsType): JSX.Element | null { function getShouldRing({ activeCall, incomingCall, -}: Readonly>): boolean { + isConversationTooBigToRing, +}: Readonly< + Pick +>): boolean { if (incomingCall) { // don't ring a large group - if (isConversationTooBigToRing(incomingCall.conversation)) { + if (isConversationTooBigToRing) { return false; } diff --git a/ts/state/smart/CallManager.tsx b/ts/state/smart/CallManager.tsx index 38cc58242f..c2a75c5e57 100644 --- a/ts/state/smart/CallManager.tsx +++ b/ts/state/smart/CallManager.tsx @@ -318,24 +318,31 @@ const mapStateToIncomingCallProp = (state: StateType) => { } }; -const mapStateToProps = (state: StateType) => ({ - activeCall: mapStateToActiveCallProp(state), - bounceAppIconStart, - bounceAppIconStop, - availableCameras: state.calling.availableCameras, - getGroupCallVideoFrameSource, - getPreferredBadge: getPreferredBadgeSelector(state), - i18n: getIntl(state), - isGroupCallOutboundRingEnabled: isGroupCallOutboundRingEnabled(), - incomingCall: mapStateToIncomingCallProp(state), - me: getMe(state), - notifyForCall, - playRingtone, - stopRingtone, - renderDeviceSelection, - renderSafetyNumberViewer, - theme: getTheme(state), -}); +const mapStateToProps = (state: StateType) => { + const incomingCall = mapStateToIncomingCallProp(state); + + return { + activeCall: mapStateToActiveCallProp(state), + bounceAppIconStart, + bounceAppIconStop, + availableCameras: state.calling.availableCameras, + getGroupCallVideoFrameSource, + getPreferredBadge: getPreferredBadgeSelector(state), + i18n: getIntl(state), + isGroupCallOutboundRingEnabled: isGroupCallOutboundRingEnabled(), + incomingCall, + me: getMe(state), + notifyForCall, + playRingtone, + stopRingtone, + renderDeviceSelection, + renderSafetyNumberViewer, + theme: getTheme(state), + isConversationTooBigToRing: incomingCall + ? isConversationTooBigToRing(incomingCall.conversation) + : false, + }; +}; const smart = connect(mapStateToProps, mapDispatchToProps);