Add "can resize left pane" feature flags

This commit is contained in:
Evan Hahn 2021-12-01 16:41:25 -06:00 committed by GitHub
parent cd91ed6f45
commit 6313b05da7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 3 deletions

View File

@ -9,6 +9,8 @@ import * as log from './logging/log';
export type ConfigKeyType =
| 'desktop.announcementGroup'
| 'desktop.calling.useWindowsAdm2'
| 'desktop.canResizeLeftPane.beta'
| 'desktop.canResizeLeftPane.production'
| 'desktop.clientExpiration'
| 'desktop.disableGV1'
| 'desktop.groupCallOutboundRing'

View File

@ -9,6 +9,7 @@ import type { PropsType as LeftPanePropsType } from '../../components/LeftPane';
import { LeftPane, LeftPaneMode } from '../../components/LeftPane';
import type { StateType } from '../reducer';
import { missingCaseError } from '../../util/missingCaseError';
import { isAlpha, isBeta } from '../../util/version';
import { ComposerStep, OneTimeModalState } from '../ducks/conversationsEnums';
import {
@ -163,12 +164,19 @@ const getModeSpecificProps = (
}
};
const canResizeLeftPane = () =>
window.Signal.RemoteConfig.isEnabled('desktop.internalUser') ||
isAlpha(window.getVersion()) ||
isBeta(window.getVersion())
? window.Signal.RemoteConfig.isEnabled('desktop.canResizeLeftPane.beta')
: window.Signal.RemoteConfig.isEnabled(
'desktop.canResizeLeftPane.production'
);
const mapStateToProps = (state: StateType) => {
return {
modeSpecificProps: getModeSpecificProps(state),
canResizeLeftPane: window.Signal.RemoteConfig.isEnabled(
'desktop.internalUser'
),
canResizeLeftPane: canResizeLeftPane(),
preferredWidthFromStorage: getPreferredLeftPaneWidth(state),
selectedConversationId: getSelectedConversationId(state),
selectedMessageId: getSelectedMessage(state)?.id,