aboutsummaryrefslogtreecommitdiffstats
path: root/apps/mobile/app/index.tsx
blob: 702269a5f778357fee4265dc3614e7944478ec78 (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="server-address" />;
  }
}