From ad3366fa5cb39f0df38c021b190081377258a4f3 Mon Sep 17 00:00:00 2001 From: ayumi-signal <143036029+ayumi-signal@users.noreply.github.com> Date: Tue, 11 Jun 2024 16:45:28 -0700 Subject: [PATCH] Use flag for calling raise hand --- ts/RemoteConfig.ts | 1 + ts/components/CallManager.stories.tsx | 1 + ts/components/CallManager.tsx | 5 +++++ ts/components/CallScreen.stories.tsx | 1 + ts/components/CallScreen.tsx | 4 +++- ts/state/smart/CallManager.tsx | 2 ++ ts/util/isGroupCallRaiseHandEnabled.ts | 14 ++++++++++++++ 7 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 ts/util/isGroupCallRaiseHandEnabled.ts diff --git a/ts/RemoteConfig.ts b/ts/RemoteConfig.ts index 2010c5e32a..9e8e1bd4ec 100644 --- a/ts/RemoteConfig.ts +++ b/ts/RemoteConfig.ts @@ -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' diff --git a/ts/components/CallManager.stories.tsx b/ts/components/CallManager.stories.tsx index 06f636b337..3dbed81c3b 100644 --- a/ts/components/CallManager.stories.tsx +++ b/ts/components/CallManager.stories.tsx @@ -88,6 +88,7 @@ const createProps = (storyProps: Partial = {}): PropsType => ({ i18n, incomingCall: null, callLink: storyProps.callLink ?? undefined, + isGroupCallRaiseHandEnabled: true, me: { ...getDefaultConversation({ color: AvatarColors[0], diff --git a/ts/components/CallManager.tsx b/ts/components/CallManager.tsx index 30f38a3a36..0f8bb1d7f9 100644 --- a/ts/components/CallManager.tsx +++ b/ts/components/CallManager.tsx @@ -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 } diff --git a/ts/components/CallScreen.stories.tsx b/ts/components/CallScreen.stories.tsx index d6e6a09f98..69e8274a64 100644 --- a/ts/components/CallScreen.stories.tsx +++ b/ts/components/CallScreen.stories.tsx @@ -193,6 +193,7 @@ const createProps = ( i18n, imageDataCache: React.createRef(), isCallLinkAdmin: true, + isGroupCallRaiseHandEnabled: true, me: getDefaultConversation({ color: AvatarColors[1], id: '6146087e-f7ef-457e-9a8d-47df1fdd6b25', diff --git a/ts/components/CallScreen.tsx b/ts/components/CallScreen.tsx index 9532f12a14..b1f0c5813a 100644 --- a/ts/components/CallScreen.tsx +++ b/ts/components/CallScreen.tsx @@ -103,6 +103,7 @@ export type PropsType = { i18n: LocalizerType; imageDataCache: React.RefObject; 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 && (