Restore ability to message someone from embedded contact
This commit is contained in:
parent
f77175f6b3
commit
302604f67e
18 changed files with 311 additions and 236 deletions
|
@ -5,20 +5,23 @@ import { createSelector } from 'reselect';
|
|||
|
||||
import type { StateType } from '../reducer';
|
||||
import type { AccountsStateType } from '../ducks/accounts';
|
||||
import type { UUIDStringType } from '../../types/UUID';
|
||||
|
||||
export const getAccounts = (state: StateType): AccountsStateType =>
|
||||
state.accounts;
|
||||
|
||||
export type AccountSelectorType = (identifier?: string) => boolean;
|
||||
export type AccountSelectorType = (
|
||||
identifier?: string
|
||||
) => UUIDStringType | undefined;
|
||||
export const getAccountSelector = createSelector(
|
||||
getAccounts,
|
||||
(accounts: AccountsStateType): AccountSelectorType => {
|
||||
return (identifier?: string) => {
|
||||
if (!identifier) {
|
||||
return false;
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return accounts.accounts[identifier] || false;
|
||||
return accounts.accounts[identifier] || undefined;
|
||||
};
|
||||
}
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue