Files
otunes/apps/mobile/app/index.tsx
T
joshuafhiggins 73c7283d4d Add Expo mobile app and extract shared Convex package
- Replace mobile placeholder with Expo Router app (tabs, playback, auth, library)
- Move Convex backend to @otunes/convex for web and mobile reuse
- Update web app imports and API routes to use shared package
2026-08-02 04:14:01 +00:00

29 lines
647 B
TypeScript

import { Redirect } from "expo-router"
import { useConvexAuth } from "@convex-dev/auth/react"
import { LoadingView } from "@/components/ui/primitives"
import { useServerConfig } from "@/contexts/server-config"
export default function Index() {
const { config, isLoading } = useServerConfig()
const { isLoading: authLoading, isAuthenticated } = useConvexAuth()
if (isLoading) {
return <LoadingView />
}
if (!config) {
return <Redirect href="/server" />
}
if (authLoading) {
return <LoadingView />
}
if (!isAuthenticated) {
return <Redirect href="/signin" />
}
return <Redirect href="/(app)/(tabs)" />
}