Discriminator in username
This commit is contained in:
@@ -18,7 +18,6 @@ import type {
|
||||
PreJoinConversationType,
|
||||
} from '../ducks/conversations';
|
||||
import type { StoriesStateType } from '../ducks/stories';
|
||||
import type { UsernameSaveState } from '../ducks/conversationsEnums';
|
||||
import {
|
||||
ComposerStep,
|
||||
OneTimeModalState,
|
||||
@@ -167,13 +166,6 @@ export const getSelectedMessage = createSelector(
|
||||
}
|
||||
);
|
||||
|
||||
export const getUsernameSaveState = createSelector(
|
||||
getConversations,
|
||||
(state: ConversationsStateType): UsernameSaveState => {
|
||||
return state.usernameSaveState;
|
||||
}
|
||||
);
|
||||
|
||||
export const getShowArchived = createSelector(
|
||||
getConversations,
|
||||
(state: ConversationsStateType): boolean => {
|
||||
|
50
ts/state/selectors/username.ts
Normal file
50
ts/state/selectors/username.ts
Normal file
@@ -0,0 +1,50 @@
|
||||
// Copyright 2022 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { createSelector } from 'reselect';
|
||||
|
||||
import type { UsernameReservationType } from '../../types/Username';
|
||||
import type { StateType } from '../reducer';
|
||||
import type {
|
||||
UsernameStateType,
|
||||
UsernameReservationStateType,
|
||||
} from '../ducks/username';
|
||||
import type {
|
||||
UsernameEditState,
|
||||
UsernameReservationState,
|
||||
UsernameReservationError,
|
||||
} from '../ducks/usernameEnums';
|
||||
|
||||
export const getUsernameState = (state: StateType): UsernameStateType =>
|
||||
state.username;
|
||||
|
||||
export const getUsernameEditState = createSelector(
|
||||
getUsernameState,
|
||||
(state: UsernameStateType): UsernameEditState => state.editState
|
||||
);
|
||||
|
||||
export const getUsernameReservation = createSelector(
|
||||
getUsernameState,
|
||||
(state: UsernameStateType): UsernameReservationStateType =>
|
||||
state.usernameReservation
|
||||
);
|
||||
|
||||
export const getUsernameReservationState = createSelector(
|
||||
getUsernameReservation,
|
||||
(reservation: UsernameReservationStateType): UsernameReservationState =>
|
||||
reservation.state
|
||||
);
|
||||
|
||||
export const getUsernameReservationObject = createSelector(
|
||||
getUsernameReservation,
|
||||
(
|
||||
reservation: UsernameReservationStateType
|
||||
): UsernameReservationType | undefined => reservation.reservation
|
||||
);
|
||||
|
||||
export const getUsernameReservationError = createSelector(
|
||||
getUsernameReservation,
|
||||
(
|
||||
reservation: UsernameReservationStateType
|
||||
): UsernameReservationError | undefined => reservation.error
|
||||
);
|
Reference in New Issue
Block a user