Files
spoon/apps/expo/src/app/index.tsx
T
Gabriel Brown 42f95530de
Build and Push Next App / quality (push) Successful in 1m27s
Build and Push Next App / build-next (push) Successful in 3m58s
Update expo application
2026-06-22 12:13:02 -04:00

29 lines
679 B
TypeScript

import { useEffect } from 'react';
import { Stack, useRouter } from 'expo-router';
import { useConvexAuth } from 'convex/react';
import { LoadingState } from '~/components/ui/loading-state';
const IndexRoute = () => {
const { isAuthenticated, isLoading } = useConvexAuth();
const router = useRouter();
useEffect(() => {
if (isLoading) return;
if (isAuthenticated) {
router.replace('/dashboard');
} else {
router.replace('/sign-in');
}
}, [isAuthenticated, isLoading, router]);
return (
<>
<Stack.Screen options={{ title: 'Spoon' }} />
<LoadingState label='Opening Spoon...' />
</>
);
};
export default IndexRoute;