1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-25 12:56:41 +07:00

added register_socials to reducer

This commit is contained in:
Fedor Katurov 2020-08-20 10:55:14 +07:00
parent 358b197c19
commit 837b4ee6f3
8 changed files with 1471 additions and 1412 deletions

62
src/redux/auth/index.ts Normal file
View file

@ -0,0 +1,62 @@
import { EMPTY_USER } from '~/redux/auth/constants';
import { createReducer } from '~/utils/reducer';
import { IAuthState } from '~/redux/auth/types';
import { AUTH_USER_HANDLERS } from '~/redux/auth/handlers';
const HANDLERS = {
...AUTH_USER_HANDLERS,
};
const INITIAL_STATE: IAuthState = {
token: null,
user: { ...EMPTY_USER },
updates: {
last: null,
notifications: [],
boris_commented_at: null,
},
login: {
error: null,
is_loading: false,
is_registering: true,
},
profile: {
tab: 'profile',
is_loading: true,
is_loading_messages: true,
is_sending_messages: false,
user: null,
messages: [],
messages_error: null,
patch_errors: {},
socials: {
accounts: [],
error: '',
is_loading: false,
},
},
restore: {
code: '',
user: null,
is_loading: false,
is_succesfull: false,
error: null,
},
register_social: {
errors: {
username: '',
password: '',
},
error: '',
token: '',
is_loading: false,
},
};
export default createReducer(INITIAL_STATE, HANDLERS);