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

not fetching user if he's logged out

This commit is contained in:
Fedor Katurov 2020-04-18 22:36:16 +07:00
parent 2b757a07a2
commit 1056f0ff72

View file

@ -39,6 +39,7 @@ import {
selectAuthUser,
selectAuthUpdates,
selectAuthRestore,
selectAuth,
} from './selectors';
import { IResultWithStatus, INotification, IMessageNotification, Unwrap } from '../types';
import { IUser, IAuthState } from './types';
@ -83,6 +84,10 @@ function* sendLoginRequestSaga({ username, password }: ReturnType<typeof userSen
}
function* refreshUser() {
const { token }: ReturnType<typeof selectAuth> = yield select(selectAuth);
if (!token) return;
const {
error,
data: { user },