iniitaldata load not fetched when user not logged in.
This commit is contained in:
parent
bb24bfd908
commit
e4f09eddac
@ -19,6 +19,9 @@ export const LoginContextProvider: FunctionComponent = (props): JSX.Element => {
|
|||||||
initialLoginState = LoginState.LoggedIn;
|
initialLoginState = LoginState.LoggedIn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const [loginState, setLoginState] = useState<LoginState>(initialLoginState);
|
||||||
|
const [permission, setPermission] = useState<LoginPerm>(initialUserPerm);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// this is the first api call so if it fails we know there is no connection to backend
|
// this is the first api call so if it fails we know there is no connection to backend
|
||||||
callAPI(
|
callAPI(
|
||||||
@ -45,10 +48,7 @@ export const LoginContextProvider: FunctionComponent = (props): JSX.Element => {
|
|||||||
setLoginState(LoginState.LoggedOut);
|
setLoginState(LoginState.LoggedOut);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}, [features]);
|
}, [features, loginState]);
|
||||||
|
|
||||||
const [loginState, setLoginState] = useState<LoginState>(initialLoginState);
|
|
||||||
const [permission, setPermission] = useState<LoginPerm>(initialUserPerm);
|
|
||||||
|
|
||||||
const hist = useHistory();
|
const hist = useHistory();
|
||||||
const loc = useLocation();
|
const loc = useLocation();
|
||||||
|
Loading…
Reference in New Issue
Block a user