Usernames: Create/update/delete in profile editor

This commit is contained in:
Scott Nonnenberg 2021-11-01 12:13:35 -07:00 committed by GitHub
parent a9cb621eb6
commit 3190f95fac
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
38 changed files with 923 additions and 89 deletions

View file

@ -5,6 +5,7 @@ import { createSelector } from 'reselect';
import { isInteger } from 'lodash';
import { ITEM_NAME as UNIVERSAL_EXPIRE_TIMER_ITEM } from '../../util/universalExpireTimer';
import type { ConfigMapType } from '../../RemoteConfig';
import type { StateType } from '../reducer';
import type { ItemsStateType } from '../ducks/items';
@ -35,6 +36,17 @@ export const getUniversalExpireTimer = createSelector(
(state: ItemsStateType): number => state[UNIVERSAL_EXPIRE_TIMER_ITEM] || 0
);
const getRemoteConfig = createSelector(
getItems,
(state: ItemsStateType): ConfigMapType | undefined => state.remoteConfig
);
export const getUsernamesEnabled = createSelector(
getRemoteConfig,
(remoteConfig?: ConfigMapType): boolean =>
Boolean(remoteConfig?.['desktop.usernames']?.enabled)
);
export const getDefaultConversationColor = createSelector(
getItems,
(