This commit is contained in:
David Arranz 2024-12-16 18:01:14 +01:00
parent 53ea788142
commit 73dff582e3

View File

@ -1,7 +1,7 @@
import { Container, FormTextField } from "@/components"; import { Container, FormTextField } from "@/components";
import { FormSubmitButton } from "@/components/Forms/FormSubmitButton"; import { FormSubmitButton } from "@/components/Forms/FormSubmitButton";
import { UeckoLogo } from "@/components/UeckoLogo/UeckoLogo"; import { UeckoLogo } from "@/components/UeckoLogo/UeckoLogo";
import { useIsLoggedIn, useLogin } from "@/lib/hooks"; import { useLogin } from "@/lib/hooks";
import { import {
Alert, Alert,
AlertDescription, AlertDescription,
@ -43,8 +43,6 @@ const languages = [
export const LoginPageWithLanguageSelector = () => { export const LoginPageWithLanguageSelector = () => {
const { t, i18n } = useTranslation(); const { t, i18n } = useTranslation();
const { isSuccess: isLoggedInSuccess, data: { authenticated = false } = {} } = useIsLoggedIn();
const [language, setLanguage] = useState(i18n.language); const [language, setLanguage] = useState(i18n.language);
const navigate = useNavigate(); const navigate = useNavigate();
const { toast } = useToast(); const { toast } = useToast();
@ -57,12 +55,6 @@ export const LoginPageWithLanguageSelector = () => {
} }
}, []); }, []);
useEffect(() => {
if (isLoggedInSuccess && authenticated) {
navigate("/quotes", { replace: true });
}
}, [isLoggedInSuccess, authenticated]);
const changeLanguage = (lng: string) => { const changeLanguage = (lng: string) => {
i18n.changeLanguage(lng); i18n.changeLanguage(lng);
setLanguage(lng); setLanguage(lng);