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

user menu

This commit is contained in:
Fedor Katurov 2019-11-05 17:14:47 +07:00
parent aff052e66d
commit 8a37fa1f1b
7 changed files with 135 additions and 62 deletions

View file

@ -85,8 +85,14 @@ function* gotPostMessageSaga({ token }: ReturnType<typeof gotPostMessage>) {
if (is_shown && dialog === DIALOGS.LOGIN) yield put(modalSetShown(false));
}
function* logoutSaga() {
yield put(authSetToken(null));
yield put(authSetUser({ ...EMPTY_USER }));
}
function* authSaga() {
yield takeLatest(REHYDRATE, checkUserSaga);
yield takeLatest(AUTH_USER_ACTIONS.LOGOUT, logoutSaga);
yield takeLatest(AUTH_USER_ACTIONS.SEND_LOGIN_REQUEST, sendLoginRequestSaga);
yield takeLatest(AUTH_USER_ACTIONS.GOT_POST_MESSAGE, gotPostMessageSaga);
}