import Menu from "@/components/menu"; import { useAppContext } from "@/providers/AuthProvider"; import { FunctionComponent } from "preact"; import { lazy, Route, Router, useLocation } from "preact-iso"; import ids from "./profile.module.scss"; const ProfilePage: FunctionComponent = () => { const { route } = useLocation(); const { isLoggedIn, isCheckingAuth } = useAppContext(); // Получаем новый сигнал if (isCheckingAuth.value) { return
Проверка авторизации...
; } if (!isLoggedIn.value) { route("/login", true); return

Redirecting...

; // Заглушка на время редиректа } return isLoggedIn.value ? (
import("./profile_settings"))} /> import("./profile_tasks"))} /> import("./profile_calendar"))} /> { route("/profile/tasks", true); return null; }} />
) : (

Redirecting...

); }; export default ProfilePage;