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

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" />;
  }
}