mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-30 18:16:48 +10:00
Ignore fetching current user when logged out
This commit is contained in:
parent
f2dd3c9105
commit
a99b33e5e8
1 changed files with 7 additions and 0 deletions
|
|
@ -72,6 +72,13 @@ export const stripeAccountCreateError = e => ({
|
|||
export const fetchCurrentUser = () =>
|
||||
(dispatch, getState, sdk) => {
|
||||
dispatch(usersMeRequest());
|
||||
const { isAuthenticated } = getState().Auth;
|
||||
|
||||
if (!isAuthenticated) {
|
||||
// Ignore when not logged in, current user should be null
|
||||
return Promise.resolve({});
|
||||
}
|
||||
|
||||
return sdk.users
|
||||
.me()
|
||||
.then(response => {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue