From 1056f0ff72f539526f81aecf598e1fedad8d7683 Mon Sep 17 00:00:00 2001 From: Fedor Katurov Date: Sat, 18 Apr 2020 22:36:16 +0700 Subject: [PATCH] not fetching user if he's logged out --- src/redux/auth/sagas.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/redux/auth/sagas.ts b/src/redux/auth/sagas.ts index 2f75616c..9664e4ea 100644 --- a/src/redux/auth/sagas.ts +++ b/src/redux/auth/sagas.ts @@ -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 = yield select(selectAuth); + + if (!token) return; + const { error, data: { user },