blob: 6affd95a271b5886f44ec21d0be6d46dedbeef4d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
import { Redirect } from 'expo-router';
import { ActivityIndicator, View } from 'react-native';
import { useAuthSession } from '@/providers/AuthProvider';
export default function IndexPage() {
const { user, loading } = useAuthSession();
if (loading) {
return (
<View
style={{
flex: 1,
alignItems: 'center',
justifyContent: 'center',
}}
>
<ActivityIndicator size="large" />
</View>
);
}
if (user) {
return <Redirect href="/home" />;
}
return <Redirect href="/(auth)/welcome" />;
}
|