aboutsummaryrefslogtreecommitdiffstats
path: root/apps/mobile/app/index.tsx
blob: 235b19e47b69be5db84ba23e0574ddf1bfe76e96 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import { useIsLoggedIn } from "@/lib/session";
import { Redirect } from "expo-router";
import FullPageSpinner from "@/components/ui/FullPageSpinner";

export default function App() {
  const isLoggedIn = useIsLoggedIn();

    if (isLoggedIn === undefined) {
      // Wait until it's loaded
      return <FullPageSpinner />;
    } else if (isLoggedIn) {
      return <Redirect href="dashboard" />
    } else {
      return <Redirect href="signin" />
    }
}