mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-26 05:16:41 +07:00
added account list and ability to drop them
This commit is contained in:
parent
2388a7e20e
commit
5396cf7611
11 changed files with 282 additions and 47 deletions
|
@ -1,7 +1,6 @@
|
|||
import { AUTH_USER_ACTIONS } from '~/redux/auth/constants';
|
||||
import * as ActionCreators from '~/redux/auth/actions';
|
||||
import { IAuthState } from '~/redux/auth/types';
|
||||
import { Action } from 'history';
|
||||
|
||||
interface ActionHandler<T> {
|
||||
(state: IAuthState, payload: T extends (...args: any[]) => infer R ? R : any): IAuthState;
|
||||
|
@ -65,6 +64,16 @@ const setRestore: ActionHandler<typeof ActionCreators.authSetRestore> = (state,
|
|||
...restore,
|
||||
},
|
||||
});
|
||||
const setSocials: ActionHandler<typeof ActionCreators.authSetSocials> = (state, { socials }) => ({
|
||||
...state,
|
||||
profile: {
|
||||
...state.profile,
|
||||
socials: {
|
||||
...state.profile.socials,
|
||||
...socials,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
export const AUTH_USER_HANDLERS = {
|
||||
[AUTH_USER_ACTIONS.SET_LOGIN_ERROR]: setLoginError,
|
||||
|
@ -74,4 +83,5 @@ export const AUTH_USER_HANDLERS = {
|
|||
[AUTH_USER_ACTIONS.SET_UPDATES]: setUpdates,
|
||||
[AUTH_USER_ACTIONS.SET_LAST_SEEN_MESSAGES]: setLastSeenMessages,
|
||||
[AUTH_USER_ACTIONS.SET_RESTORE]: setRestore,
|
||||
[AUTH_USER_ACTIONS.SET_SOCIALS]: setSocials,
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue