File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import { Text, View } from "react-native";
33import { SafeAreaView } from "react-native-safe-area-context" ;
44import * as Notifications from "expo-notifications" ;
55import { Redirect , Stack } from "expo-router" ;
6+ import { useAuth } from "@clerk/clerk-expo" ;
67
78import registerForPushNotificationsAsync from "~/notifications/registerNotifications" ;
89
@@ -19,6 +20,7 @@ const Index = () => {
1920 const [ , setExpoPushToken ] = useState < Notifications . ExpoPushToken | null > (
2021 null ,
2122 ) ;
23+ const { isSignedIn } = useAuth ( ) ;
2224
2325 useEffect ( ( ) => {
2426 registerForPushNotificationsAsync ( )
@@ -33,7 +35,7 @@ const Index = () => {
3335 < View className = "h-full w-full p-4" >
3436 < Text className = "font-poppins400" > Index </ Text >
3537 </ View >
36- < Redirect href = "/ signin" />
38+ < Redirect href = { isSignedIn ? "/calendar/" : "/ signin"} />
3739 </ SafeAreaView >
3840 ) ;
3941} ;
You can’t perform that action at this time.
0 commit comments