mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-25 04:36:46 +00:00
Use flag for calling raise hand
This commit is contained in:
@@ -17,6 +17,7 @@ import { getCountryCode } from './types/PhoneNumber';
|
||||
export type ConfigKeyType =
|
||||
| 'desktop.calling.adhoc'
|
||||
| 'desktop.calling.adhoc.create'
|
||||
| 'desktop.calling.raiseHand'
|
||||
| 'desktop.clientExpiration'
|
||||
| 'desktop.backup.credentialFetch'
|
||||
| 'desktop.deleteSync.send'
|
||||
|
||||
@@ -88,6 +88,7 @@ const createProps = (storyProps: Partial<PropsType> = {}): PropsType => ({
|
||||
i18n,
|
||||
incomingCall: null,
|
||||
callLink: storyProps.callLink ?? undefined,
|
||||
isGroupCallRaiseHandEnabled: true,
|
||||
me: {
|
||||
...getDefaultConversation({
|
||||
color: AvatarColors[0],
|
||||
|
||||
@@ -106,6 +106,7 @@ export type PropsType = {
|
||||
denyUser: (payload: PendingUserActionPayloadType) => void;
|
||||
hasInitialLoadCompleted: boolean;
|
||||
i18n: LocalizerType;
|
||||
isGroupCallRaiseHandEnabled: boolean;
|
||||
me: ConversationType;
|
||||
notifyForCall: (
|
||||
conversationId: string,
|
||||
@@ -164,6 +165,7 @@ function ActiveCallManager({
|
||||
denyUser,
|
||||
hangUpActiveCall,
|
||||
i18n,
|
||||
isGroupCallRaiseHandEnabled,
|
||||
getIsSharingPhoneNumberWithEverybody,
|
||||
getGroupCallVideoFrameSource,
|
||||
getPresentingSources,
|
||||
@@ -429,6 +431,7 @@ function ActiveCallManager({
|
||||
i18n={i18n}
|
||||
imageDataCache={imageDataCache}
|
||||
isCallLinkAdmin={isCallLinkAdmin}
|
||||
isGroupCallRaiseHandEnabled={isGroupCallRaiseHandEnabled}
|
||||
me={me}
|
||||
openSystemPreferencesAction={openSystemPreferencesAction}
|
||||
renderEmojiPicker={renderEmojiPicker}
|
||||
@@ -503,6 +506,7 @@ export function CallManager({
|
||||
i18n,
|
||||
incomingCall,
|
||||
isConversationTooBigToRing,
|
||||
isGroupCallRaiseHandEnabled,
|
||||
getIsSharingPhoneNumberWithEverybody,
|
||||
me,
|
||||
notifyForCall,
|
||||
@@ -592,6 +596,7 @@ export function CallManager({
|
||||
getPresentingSources={getPresentingSources}
|
||||
hangUpActiveCall={hangUpActiveCall}
|
||||
i18n={i18n}
|
||||
isGroupCallRaiseHandEnabled={isGroupCallRaiseHandEnabled}
|
||||
getIsSharingPhoneNumberWithEverybody={
|
||||
getIsSharingPhoneNumberWithEverybody
|
||||
}
|
||||
|
||||
@@ -193,6 +193,7 @@ const createProps = (
|
||||
i18n,
|
||||
imageDataCache: React.createRef<CallingImageDataCache>(),
|
||||
isCallLinkAdmin: true,
|
||||
isGroupCallRaiseHandEnabled: true,
|
||||
me: getDefaultConversation({
|
||||
color: AvatarColors[1],
|
||||
id: '6146087e-f7ef-457e-9a8d-47df1fdd6b25',
|
||||
|
||||
@@ -103,6 +103,7 @@ export type PropsType = {
|
||||
i18n: LocalizerType;
|
||||
imageDataCache: React.RefObject<CallingImageDataCache>;
|
||||
isCallLinkAdmin: boolean;
|
||||
isGroupCallRaiseHandEnabled: boolean;
|
||||
me: ConversationType;
|
||||
openSystemPreferencesAction: () => unknown;
|
||||
renderReactionPicker: (
|
||||
@@ -194,6 +195,7 @@ export function CallScreen({
|
||||
i18n,
|
||||
imageDataCache,
|
||||
isCallLinkAdmin,
|
||||
isGroupCallRaiseHandEnabled,
|
||||
me,
|
||||
openSystemPreferencesAction,
|
||||
renderEmojiPicker,
|
||||
@@ -931,7 +933,7 @@ export function CallScreen({
|
||||
onClick={toggleAudio}
|
||||
tooltipDirection={TooltipPlacement.Top}
|
||||
/>
|
||||
{raiseHandButtonType && (
|
||||
{isGroupCallRaiseHandEnabled && raiseHandButtonType && (
|
||||
<CallingButton
|
||||
buttonType={raiseHandButtonType}
|
||||
i18n={i18n}
|
||||
|
||||
@@ -37,6 +37,7 @@ import type { AciString } from '../../types/ServiceId';
|
||||
import { strictAssert } from '../../util/assert';
|
||||
import { callLinkToConversation } from '../../util/callLinks';
|
||||
import { callingTones } from '../../util/callingTones';
|
||||
import { isGroupCallRaiseHandEnabled } from '../../util/isGroupCallRaiseHandEnabled';
|
||||
import { missingCaseError } from '../../util/missingCaseError';
|
||||
import { useAudioPlayerActions } from '../ducks/audioPlayer';
|
||||
import { getActiveCall, useCallingActions } from '../ducks/calling';
|
||||
@@ -478,6 +479,7 @@ export const SmartCallManager = memo(function SmartCallManager() {
|
||||
i18n={i18n}
|
||||
incomingCall={incomingCall}
|
||||
isConversationTooBigToRing={isConversationTooBigToRing}
|
||||
isGroupCallRaiseHandEnabled={isGroupCallRaiseHandEnabled()}
|
||||
me={me}
|
||||
notifyForCall={notifyForCall}
|
||||
openSystemPreferencesAction={openSystemPreferencesAction}
|
||||
|
||||
14
ts/util/isGroupCallRaiseHandEnabled.ts
Normal file
14
ts/util/isGroupCallRaiseHandEnabled.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
// Copyright 2023 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import * as RemoteConfig from '../RemoteConfig';
|
||||
import { isProduction } from './version';
|
||||
|
||||
export function isGroupCallRaiseHandEnabled(): boolean {
|
||||
if (!isProduction(window.getVersion())) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// In production, use the config
|
||||
return Boolean(RemoteConfig.isEnabled('desktop.calling.raiseHand'));
|
||||
}
|
||||
Reference in New Issue
Block a user