Moved isConversationTooBigToRing to the SmartCallManager
This commit is contained in:
parent
1e282ee5d0
commit
cdb779508b
3 changed files with 32 additions and 21 deletions
|
@ -116,6 +116,7 @@ const createProps = (storyProps: Partial<PropsType> = {}): PropsType => ({
|
||||||
),
|
),
|
||||||
toggleSettings: action('toggle-settings'),
|
toggleSettings: action('toggle-settings'),
|
||||||
toggleSpeakerView: action('toggle-speaker-view'),
|
toggleSpeakerView: action('toggle-speaker-view'),
|
||||||
|
isConversationTooBigToRing: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|
|
@ -41,7 +41,6 @@ import type {
|
||||||
} from '../state/ducks/calling';
|
} from '../state/ducks/calling';
|
||||||
import type { LocalizerType, ThemeType } from '../types/Util';
|
import type { LocalizerType, ThemeType } from '../types/Util';
|
||||||
import { missingCaseError } from '../util/missingCaseError';
|
import { missingCaseError } from '../util/missingCaseError';
|
||||||
import { isConversationTooBigToRing } from '../conversations/isConversationTooBigToRing';
|
|
||||||
|
|
||||||
const GROUP_CALL_RING_DURATION = 60 * 1000;
|
const GROUP_CALL_RING_DURATION = 60 * 1000;
|
||||||
|
|
||||||
|
@ -100,6 +99,7 @@ export type PropsType = {
|
||||||
toggleScreenRecordingPermissionsDialog: () => unknown;
|
toggleScreenRecordingPermissionsDialog: () => unknown;
|
||||||
toggleSettings: () => void;
|
toggleSettings: () => void;
|
||||||
toggleSpeakerView: () => void;
|
toggleSpeakerView: () => void;
|
||||||
|
isConversationTooBigToRing: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
type ActiveCallManagerPropsType = PropsType & {
|
type ActiveCallManagerPropsType = PropsType & {
|
||||||
|
@ -455,10 +455,13 @@ export function CallManager(props: PropsType): JSX.Element | null {
|
||||||
function getShouldRing({
|
function getShouldRing({
|
||||||
activeCall,
|
activeCall,
|
||||||
incomingCall,
|
incomingCall,
|
||||||
}: Readonly<Pick<PropsType, 'activeCall' | 'incomingCall'>>): boolean {
|
isConversationTooBigToRing,
|
||||||
|
}: Readonly<
|
||||||
|
Pick<PropsType, 'activeCall' | 'incomingCall' | 'isConversationTooBigToRing'>
|
||||||
|
>): boolean {
|
||||||
if (incomingCall) {
|
if (incomingCall) {
|
||||||
// don't ring a large group
|
// don't ring a large group
|
||||||
if (isConversationTooBigToRing(incomingCall.conversation)) {
|
if (isConversationTooBigToRing) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -318,24 +318,31 @@ const mapStateToIncomingCallProp = (state: StateType) => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const mapStateToProps = (state: StateType) => ({
|
const mapStateToProps = (state: StateType) => {
|
||||||
activeCall: mapStateToActiveCallProp(state),
|
const incomingCall = mapStateToIncomingCallProp(state);
|
||||||
bounceAppIconStart,
|
|
||||||
bounceAppIconStop,
|
return {
|
||||||
availableCameras: state.calling.availableCameras,
|
activeCall: mapStateToActiveCallProp(state),
|
||||||
getGroupCallVideoFrameSource,
|
bounceAppIconStart,
|
||||||
getPreferredBadge: getPreferredBadgeSelector(state),
|
bounceAppIconStop,
|
||||||
i18n: getIntl(state),
|
availableCameras: state.calling.availableCameras,
|
||||||
isGroupCallOutboundRingEnabled: isGroupCallOutboundRingEnabled(),
|
getGroupCallVideoFrameSource,
|
||||||
incomingCall: mapStateToIncomingCallProp(state),
|
getPreferredBadge: getPreferredBadgeSelector(state),
|
||||||
me: getMe(state),
|
i18n: getIntl(state),
|
||||||
notifyForCall,
|
isGroupCallOutboundRingEnabled: isGroupCallOutboundRingEnabled(),
|
||||||
playRingtone,
|
incomingCall,
|
||||||
stopRingtone,
|
me: getMe(state),
|
||||||
renderDeviceSelection,
|
notifyForCall,
|
||||||
renderSafetyNumberViewer,
|
playRingtone,
|
||||||
theme: getTheme(state),
|
stopRingtone,
|
||||||
});
|
renderDeviceSelection,
|
||||||
|
renderSafetyNumberViewer,
|
||||||
|
theme: getTheme(state),
|
||||||
|
isConversationTooBigToRing: incomingCall
|
||||||
|
? isConversationTooBigToRing(incomingCall.conversation)
|
||||||
|
: false,
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
const smart = connect(mapStateToProps, mapDispatchToProps);
|
const smart = connect(mapStateToProps, mapDispatchToProps);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue