- 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
29 lines
647 B
TypeScript
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)" />
|
|
}
|