bb-plane-fork/apps/space/app/page.tsx
Anmol Singh Bhatia 21c59692f9
[WEB-4635] fix: space auth screen re-loading issue (#7551)
* fix: prevent auth redirect on window focus

* fix: space auth screen re-loading issue.

---------

Co-authored-by: Prateek Shourya <prateekshourya29@gmail.com>
Co-authored-by: sriram veeraghanta <veeraghanta.sriram@gmail.com>
2025-08-06 22:32:52 +05:30

26 lines
665 B
TypeScript

"use client";
import { observer } from "mobx-react";
// components
import { UserLoggedIn } from "@/components/account";
import { LogoSpinner } from "@/components/common";
import { AuthView } from "@/components/views";
// hooks
import { useUser } from "@/hooks/store";
const HomePage = observer(() => {
const { data: currentUser, isAuthenticated, isInitializing } = useUser();
if (isInitializing)
return (
<div className="flex h-screen min-h-[500px] w-full justify-center items-center">
<LogoSpinner />
</div>
);
if (currentUser && isAuthenticated) return <UserLoggedIn />;
return <AuthView />;
});
export default HomePage;