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:
parent
2b757a07a2
commit
1056f0ff72
1 changed files with 5 additions and 0 deletions
|
@ -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 },
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue