Web: Login: add loader

This commit is contained in:
Viktor Fomin 2022-03-03 13:08:56 +03:00
parent f161598193
commit 5a355090dd

View File

@ -38,6 +38,7 @@ import {
LoginContainer,
LoginFormWrapper,
} from "./StyledLogin";
import AppLoader from "@appserver/common/components/AppLoader";
const settings = {
minLength: 6,
@ -65,6 +66,8 @@ const Form = (props) => {
const [errorText, setErrorText] = useState("");
const [isLoaded, setIsLoaded] = useState(false);
const { t } = useTranslation("Login");
const {
@ -110,7 +113,6 @@ const Form = (props) => {
};
useEffect(() => {
getSso();
const profile = localStorage.getItem("profile");
if (!profile) return;
@ -157,11 +159,14 @@ const Form = (props) => {
error && setErrorText(error);
confirmedEmail && setIdentifier(confirmedEmail);
await setProviders();
await getSso();
setIsLoaded(true);
focusInput();
window.authCallback = authCallback;
await setProviders();
//window.addEventListener("keyup", throttledKeyPress, false);
/*return () => {
@ -343,6 +348,7 @@ const Form = (props) => {
//console.log("Login render");
if (!isLoaded) return <AppLoader />;
return (
<LoginContainer>
<Text