Co-authored-by: scott@signal.org
Co-authored-by: ken@signal.org
This commit is contained in:
Ken Powers
2019-05-16 15:32:11 -07:00
committed by Scott Nonnenberg
parent 8c8856785b
commit 29de50c12a
100 changed files with 7572 additions and 693 deletions

View File

@@ -1,8 +1,11 @@
import { AnyAction } from 'redux';
import { LocalizerType } from '../../types/Util';
// State
export type UserStateType = {
attachmentsPath: string;
stickersPath: string;
ourNumber: string;
regionCode: string;
i18n: LocalizerType;
@@ -18,7 +21,7 @@ type UserChangedActionType = {
};
};
export type UserActionType = UserChangedActionType;
export type UserActionType = AnyAction | UserChangedActionType;
// Action Creators
@@ -40,6 +43,8 @@ function userChanged(attributes: {
function getEmptyState(): UserStateType {
return {
attachmentsPath: 'missing',
stickersPath: 'missing',
ourNumber: 'missing',
regionCode: 'missing',
i18n: () => 'missing',
@@ -47,7 +52,7 @@ function getEmptyState(): UserStateType {
}
export function reducer(
state: UserStateType,
state: UserStateType = getEmptyState(),
action: UserActionType
): UserStateType {
if (!state) {