Cleanup RemoteConfig
This commit is contained in:
parent
7bad05f5a0
commit
b2a3605d77
53 changed files with 121 additions and 614 deletions
|
@ -40,7 +40,6 @@ import {
|
|||
} from '../../types/Calling';
|
||||
import { callingTones } from '../../util/callingTones';
|
||||
import { requestCameraPermissions } from '../../util/callingPermissions';
|
||||
import { isGroupCallOutboundRingEnabled } from '../../util/isGroupCallOutboundRingEnabled';
|
||||
import { sleep } from '../../util/sleep';
|
||||
import { LatestQueue } from '../../util/LatestQueue';
|
||||
import type { AciString } from '../../types/ServiceId';
|
||||
|
@ -1573,7 +1572,7 @@ function startCall(
|
|||
|
||||
const state = getState();
|
||||
const { activeCallState } = state.calling;
|
||||
if (isGroupCallOutboundRingEnabled() && activeCallState?.outgoingRing) {
|
||||
if (activeCallState?.outgoingRing) {
|
||||
const conversation = getOwn(
|
||||
state.conversations.conversationLookup,
|
||||
activeCallState.conversationId
|
||||
|
@ -1777,7 +1776,6 @@ export function reducer(
|
|||
...ringState,
|
||||
};
|
||||
outgoingRing =
|
||||
isGroupCallOutboundRingEnabled() &&
|
||||
!ringState.ringId &&
|
||||
!call.peekInfo?.acis.length &&
|
||||
!call.remoteParticipants.length &&
|
||||
|
|
|
@ -322,7 +322,6 @@ export type ConversationType = ReadonlyDeep<
|
|||
groupVersion?: 1 | 2;
|
||||
groupId?: string;
|
||||
groupLink?: string;
|
||||
messageRequestsEnabled?: boolean;
|
||||
acceptedMessageRequest: boolean;
|
||||
secretParams?: string;
|
||||
publicParams?: string;
|
||||
|
|
|
@ -6,7 +6,6 @@ import { createSelector } from 'reselect';
|
|||
import type { StateType } from '../reducer';
|
||||
import type { ComposerStateType, QuotedMessageType } from '../ducks/composer';
|
||||
import { getComposerStateForConversation } from '../ducks/composer';
|
||||
import { getRemoteConfig, isRemoteConfigFlagEnabled } from './items';
|
||||
|
||||
export const getComposerState = (state: StateType): ComposerStateType =>
|
||||
state.composer;
|
||||
|
@ -23,20 +22,3 @@ export const getQuotedMessageSelector = createSelector(
|
|||
(conversationId: string): QuotedMessageType | undefined =>
|
||||
composerStateForConversationIdSelector(conversationId).quotedMessage
|
||||
);
|
||||
|
||||
export const getIsFormattingFlagEnabled = createSelector(
|
||||
getRemoteConfig,
|
||||
remoteConfig => {
|
||||
return isRemoteConfigFlagEnabled(remoteConfig, 'desktop.textFormatting');
|
||||
}
|
||||
);
|
||||
|
||||
export const getIsFormattingSpoilersFlagEnabled = createSelector(
|
||||
getRemoteConfig,
|
||||
remoteConfig => {
|
||||
return isRemoteConfigFlagEnabled(
|
||||
remoteConfig,
|
||||
'desktop.textFormatting.spoilerSend'
|
||||
);
|
||||
}
|
||||
);
|
||||
|
|
|
@ -1054,7 +1054,6 @@ export function isMissingRequiredProfileSharing(
|
|||
return Boolean(
|
||||
doesConversationRequireIt &&
|
||||
!conversation.profileSharing &&
|
||||
window.Signal.RemoteConfig.isEnabled('desktop.mandatoryProfileSharing') &&
|
||||
conversation.hasMessages
|
||||
);
|
||||
}
|
||||
|
|
|
@ -16,10 +16,8 @@ import type {
|
|||
import type { AciString } from '../../types/ServiceId';
|
||||
import { DEFAULT_CONVERSATION_COLOR } from '../../types/Colors';
|
||||
import { getPreferredReactionEmoji as getPreferredReactionEmojiFromStoredValue } from '../../reactions/preferredReactionEmoji';
|
||||
import { isBeta } from '../../util/version';
|
||||
import { DurationInSeconds } from '../../util/durations';
|
||||
import * as Bytes from '../../Bytes';
|
||||
import { getUserNumber, getUserACI } from './user';
|
||||
import { contactByEncryptedUsernameRoute } from '../../util/signalRoutes';
|
||||
|
||||
const DEFAULT_PREFERRED_LEFT_PANE_WIDTH = 320;
|
||||
|
@ -55,7 +53,7 @@ export const isRemoteConfigFlagEnabled = (
|
|||
): boolean => Boolean(config[key]?.enabled);
|
||||
|
||||
// See isBucketValueEnabled in RemoteConfig.ts
|
||||
const isRemoteConfigBucketEnabled = (
|
||||
export const isRemoteConfigBucketEnabled = (
|
||||
config: Readonly<ConfigMapType>,
|
||||
name: ConfigKeyType,
|
||||
e164: string | undefined,
|
||||
|
@ -138,38 +136,7 @@ export const isInternalUser = createSelector(
|
|||
// Note: ts/util/stories is the other place this check is done
|
||||
export const getStoriesEnabled = createSelector(
|
||||
getItems,
|
||||
getRemoteConfig,
|
||||
getUserNumber,
|
||||
getUserACI,
|
||||
(
|
||||
state: ItemsStateType,
|
||||
remoteConfig: ConfigMapType,
|
||||
e164: string | undefined,
|
||||
aci: AciString | undefined
|
||||
): boolean => {
|
||||
if (state.hasStoriesDisabled) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (
|
||||
isRemoteConfigBucketEnabled(remoteConfig, 'desktop.stories2', e164, aci)
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (isRemoteConfigFlagEnabled(remoteConfig, 'desktop.internalUser')) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (
|
||||
isRemoteConfigFlagEnabled(remoteConfig, 'desktop.stories2.beta') &&
|
||||
isBeta(window.getVersion())
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
(state: ItemsStateType): boolean => !state.hasStoriesDisabled
|
||||
);
|
||||
|
||||
export const getDefaultConversationColor = createSelector(
|
||||
|
|
|
@ -12,7 +12,6 @@ import { getMe, getConversationSelector } from '../selectors/conversations';
|
|||
import { getActiveCall } from '../ducks/calling';
|
||||
import type { ConversationType } from '../ducks/conversations';
|
||||
import { getIncomingCall } from '../selectors/calling';
|
||||
import { isGroupCallOutboundRingEnabled } from '../../util/isGroupCallOutboundRingEnabled';
|
||||
import { isGroupCallRaiseHandEnabled } from '../../util/isGroupCallRaiseHandEnabled';
|
||||
import { isGroupCallReactionsEnabled } from '../../util/isGroupCallReactionsEnabled';
|
||||
import type {
|
||||
|
@ -375,7 +374,6 @@ const mapStateToProps = (state: StateType) => {
|
|||
getGroupCallVideoFrameSource,
|
||||
getPreferredBadge: getPreferredBadgeSelector(state),
|
||||
i18n: getIntl(state),
|
||||
isGroupCallOutboundRingEnabled: isGroupCallOutboundRingEnabled(),
|
||||
isGroupCallRaiseHandEnabled: isGroupCallRaiseHandEnabled(),
|
||||
isGroupCallReactionsEnabled: isGroupCallReactionsEnabled(),
|
||||
incomingCall,
|
||||
|
|
|
@ -48,11 +48,7 @@ import {
|
|||
getRecentStickers,
|
||||
} from '../selectors/stickers';
|
||||
import { isSignalConversation } from '../../util/isSignalConversation';
|
||||
import {
|
||||
getComposerStateForConversationIdSelector,
|
||||
getIsFormattingFlagEnabled,
|
||||
getIsFormattingSpoilersFlagEnabled,
|
||||
} from '../selectors/composer';
|
||||
import { getComposerStateForConversationIdSelector } from '../selectors/composer';
|
||||
import type { SmartCompositionRecordingProps } from './CompositionRecording';
|
||||
import { SmartCompositionRecording } from './CompositionRecording';
|
||||
import type { SmartCompositionRecordingDraftProps } from './CompositionRecordingDraft';
|
||||
|
@ -131,9 +127,6 @@ const mapStateToProps = (state: StateType, props: ExternalProps) => {
|
|||
const selectedMessageIds = getSelectedMessageIds(state);
|
||||
|
||||
const isFormattingEnabled = getTextFormattingEnabled(state);
|
||||
const isFormattingFlagEnabled = getIsFormattingFlagEnabled(state);
|
||||
const isFormattingSpoilersFlagEnabled =
|
||||
getIsFormattingSpoilersFlagEnabled(state);
|
||||
|
||||
const lastEditableMessageId = getLastEditableMessageId(state);
|
||||
|
||||
|
@ -152,8 +145,6 @@ const mapStateToProps = (state: StateType, props: ExternalProps) => {
|
|||
i18n: getIntl(state),
|
||||
isDisabled,
|
||||
isFormattingEnabled,
|
||||
isFormattingFlagEnabled,
|
||||
isFormattingSpoilersFlagEnabled,
|
||||
lastEditableMessageId,
|
||||
messageCompositionId,
|
||||
platform,
|
||||
|
|
|
@ -10,10 +10,6 @@ import { useActions as useEmojiActions } from '../ducks/emojis';
|
|||
import { useItemsActions } from '../ducks/items';
|
||||
import { getPreferredBadgeSelector } from '../selectors/badges';
|
||||
import { useComposerActions } from '../ducks/composer';
|
||||
import {
|
||||
getIsFormattingFlagEnabled,
|
||||
getIsFormattingSpoilersFlagEnabled,
|
||||
} from '../selectors/composer';
|
||||
import { getTextFormattingEnabled } from '../selectors/items';
|
||||
|
||||
export type SmartCompositionTextAreaProps = Pick<
|
||||
|
@ -42,10 +38,6 @@ export function SmartCompositionTextArea(
|
|||
|
||||
const getPreferredBadge = useSelector(getPreferredBadgeSelector);
|
||||
const isFormattingEnabled = useSelector(getTextFormattingEnabled);
|
||||
const isFormattingFlagEnabled = useSelector(getIsFormattingFlagEnabled);
|
||||
const isFormattingSpoilersFlagEnabled = useSelector(
|
||||
getIsFormattingSpoilersFlagEnabled
|
||||
);
|
||||
|
||||
return (
|
||||
<CompositionTextArea
|
||||
|
@ -53,8 +45,6 @@ export function SmartCompositionTextArea(
|
|||
getPreferredBadge={getPreferredBadge}
|
||||
i18n={i18n}
|
||||
isFormattingEnabled={isFormattingEnabled}
|
||||
isFormattingFlagEnabled={isFormattingFlagEnabled}
|
||||
isFormattingSpoilersFlagEnabled={isFormattingSpoilersFlagEnabled}
|
||||
onPickEmoji={onPickEmoji}
|
||||
onSetSkinTone={onSetSkinTone}
|
||||
onTextTooLong={onTextTooLong}
|
||||
|
|
|
@ -14,10 +14,6 @@ import {
|
|||
getKnownStickerPacks,
|
||||
getReceivedStickerPacks,
|
||||
} from '../selectors/stickers';
|
||||
import {
|
||||
getIsFormattingFlagEnabled,
|
||||
getIsFormattingSpoilersFlagEnabled,
|
||||
} from '../selectors/composer';
|
||||
|
||||
const mapStateToProps = (state: StateType) => {
|
||||
const blessedPacks = getBlessedStickerPacks(state);
|
||||
|
@ -25,10 +21,6 @@ const mapStateToProps = (state: StateType) => {
|
|||
const knownPacks = getKnownStickerPacks(state);
|
||||
const receivedPacks = getReceivedStickerPacks(state);
|
||||
|
||||
const isFormattingFlagEnabled = getIsFormattingFlagEnabled(state);
|
||||
const isFormattingSpoilersFlagEnabled =
|
||||
getIsFormattingSpoilersFlagEnabled(state);
|
||||
|
||||
const hasInstalledStickers =
|
||||
countStickers({
|
||||
knownPacks,
|
||||
|
@ -41,8 +33,6 @@ const mapStateToProps = (state: StateType) => {
|
|||
|
||||
return {
|
||||
hasInstalledStickers,
|
||||
isFormattingFlagEnabled,
|
||||
isFormattingSpoilersFlagEnabled,
|
||||
platform,
|
||||
i18n: getIntl(state),
|
||||
};
|
||||
|
|
|
@ -23,10 +23,6 @@ import {
|
|||
getRecentStickers,
|
||||
} from '../selectors/stickers';
|
||||
import { getAddStoryData } from '../selectors/stories';
|
||||
import {
|
||||
getIsFormattingFlagEnabled,
|
||||
getIsFormattingSpoilersFlagEnabled,
|
||||
} from '../selectors/composer';
|
||||
import { getLinkPreview } from '../selectors/linkPreviews';
|
||||
import { getPreferredBadgeSelector } from '../selectors/badges';
|
||||
import {
|
||||
|
@ -108,10 +104,6 @@ export function SmartStoryCreator(): JSX.Element | null {
|
|||
const { onUseEmoji: onPickEmoji } = useEmojisActions();
|
||||
|
||||
const isFormattingEnabled = useSelector(getTextFormattingEnabled);
|
||||
const isFormattingFlagEnabled = useSelector(getIsFormattingFlagEnabled);
|
||||
const isFormattingSpoilersFlagEnabled = useSelector(
|
||||
getIsFormattingSpoilersFlagEnabled
|
||||
);
|
||||
const platform = useSelector(getPlatform);
|
||||
|
||||
return (
|
||||
|
@ -128,8 +120,6 @@ export function SmartStoryCreator(): JSX.Element | null {
|
|||
imageToBlurHash={imageToBlurHash}
|
||||
installedPacks={installedPacks}
|
||||
isFormattingEnabled={isFormattingEnabled}
|
||||
isFormattingFlagEnabled={isFormattingFlagEnabled}
|
||||
isFormattingSpoilersFlagEnabled={isFormattingSpoilersFlagEnabled}
|
||||
isSending={isSending}
|
||||
linkPreview={linkPreviewForSource(LinkPreviewSourceType.StoryCreator)}
|
||||
me={me}
|
||||
|
|
|
@ -40,10 +40,6 @@ import { useAudioPlayerActions } from '../ducks/audioPlayer';
|
|||
import { useGlobalModalActions } from '../ducks/globalModals';
|
||||
import { useStoriesActions } from '../ducks/stories';
|
||||
import { useIsWindowActive } from '../../hooks/useIsWindowActive';
|
||||
import {
|
||||
getIsFormattingFlagEnabled,
|
||||
getIsFormattingSpoilersFlagEnabled,
|
||||
} from '../selectors/composer';
|
||||
|
||||
export function SmartStoryViewer(): JSX.Element | null {
|
||||
const storiesActions = useStoriesActions();
|
||||
|
@ -95,10 +91,6 @@ export function SmartStoryViewer(): JSX.Element | null {
|
|||
);
|
||||
|
||||
const isFormattingEnabled = useSelector(getTextFormattingEnabled);
|
||||
const isFormattingFlagEnabled = useSelector(getIsFormattingFlagEnabled);
|
||||
const isFormattingSpoilersFlagEnabled = useSelector(
|
||||
getIsFormattingSpoilersFlagEnabled
|
||||
);
|
||||
|
||||
const { pauseVoiceNotePlayer } = useAudioPlayerActions();
|
||||
|
||||
|
@ -126,8 +118,6 @@ export function SmartStoryViewer(): JSX.Element | null {
|
|||
platform={platform}
|
||||
isInternalUser={internalUser}
|
||||
isFormattingEnabled={isFormattingEnabled}
|
||||
isFormattingFlagEnabled={isFormattingFlagEnabled}
|
||||
isFormattingSpoilersFlagEnabled={isFormattingSpoilersFlagEnabled}
|
||||
isSignalConversation={isSignalConversation({
|
||||
id: conversationStory.conversationId,
|
||||
})}
|
||||
|
|
|
@ -244,10 +244,7 @@ const mapStateToProps = (state: StateType, props: ExternalProps) => {
|
|||
'typingContactIdTimestamps',
|
||||
]),
|
||||
isConversationSelected: state.conversations.selectedConversationId === id,
|
||||
isIncomingMessageRequest: Boolean(
|
||||
conversation.messageRequestsEnabled &&
|
||||
!conversation.acceptedMessageRequest
|
||||
),
|
||||
isIncomingMessageRequest: Boolean(!conversation.acceptedMessageRequest),
|
||||
isSomeoneTyping: Boolean(
|
||||
Object.keys(conversation.typingContactIdTimestamps ?? {}).length > 0
|
||||
),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue