2020-10-30 20:34:04 +00:00
|
|
|
// Copyright 2019-2020 Signal Messenger, LLC
|
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
2019-01-14 21:49:58 +00:00
|
|
|
import { createSelector } from 'reselect';
|
|
|
|
|
|
|
|
import { LocalizerType } from '../../types/Util';
|
|
|
|
|
|
|
|
import { StateType } from '../reducer';
|
|
|
|
import { UserStateType } from '../ducks/user';
|
|
|
|
|
|
|
|
export const getUser = (state: StateType): UserStateType => state.user;
|
|
|
|
|
|
|
|
export const getUserNumber = createSelector(
|
|
|
|
getUser,
|
|
|
|
(state: UserStateType): string => state.ourNumber
|
|
|
|
);
|
|
|
|
|
|
|
|
export const getRegionCode = createSelector(
|
|
|
|
getUser,
|
|
|
|
(state: UserStateType): string => state.regionCode
|
|
|
|
);
|
|
|
|
|
2020-03-05 21:14:58 +00:00
|
|
|
export const getUserConversationId = createSelector(
|
|
|
|
getUser,
|
|
|
|
(state: UserStateType): string => state.ourConversationId
|
|
|
|
);
|
|
|
|
|
|
|
|
export const getUserUuid = createSelector(
|
|
|
|
getUser,
|
|
|
|
(state: UserStateType): string => state.ourUuid
|
|
|
|
);
|
|
|
|
|
2019-01-14 21:49:58 +00:00
|
|
|
export const getIntl = createSelector(
|
|
|
|
getUser,
|
|
|
|
(state: UserStateType): LocalizerType => state.i18n
|
|
|
|
);
|
2019-05-16 22:32:11 +00:00
|
|
|
|
2019-11-21 19:16:06 +00:00
|
|
|
export const getInteractionMode = createSelector(
|
|
|
|
getUser,
|
|
|
|
(state: UserStateType) => state.interactionMode
|
|
|
|
);
|
|
|
|
|
2019-05-16 22:32:11 +00:00
|
|
|
export const getAttachmentsPath = createSelector(
|
|
|
|
getUser,
|
|
|
|
(state: UserStateType): string => state.attachmentsPath
|
|
|
|
);
|
|
|
|
|
|
|
|
export const getStickersPath = createSelector(
|
|
|
|
getUser,
|
|
|
|
(state: UserStateType): string => state.stickersPath
|
|
|
|
);
|
2019-05-24 01:27:42 +00:00
|
|
|
|
2019-11-07 21:36:16 +00:00
|
|
|
export const getPlatform = createSelector(
|
|
|
|
getUser,
|
|
|
|
(state: UserStateType): string => state.platform
|
|
|
|
);
|
|
|
|
|
2019-05-24 01:27:42 +00:00
|
|
|
export const getTempPath = createSelector(
|
|
|
|
getUser,
|
|
|
|
(state: UserStateType): string => state.tempPath
|
|
|
|
);
|