File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11// navigation
22import { Stack } from "expo-router" ;
33
4-
54//contexts
65import { ModalProvider } from "@contexts/modalContext" ;
7- import { UserDataProvider } from "@contexts/userContext" ;
8-
6+ // import { UserDataProvider } from "@contexts/userContext";
97
108export default function RootLayout ( ) {
119
1210 return (
1311 < ModalProvider >
14- < UserDataProvider >
15- < Stack initialRouteName = { "index" } screenOptions = { { contentStyle : { backgroundColor : "#17171d" } , headerShown : false , animation : "fade" } } >
16- </ Stack >
17- </ UserDataProvider >
12+ { /* <UserDataProvider> */ }
13+ < Stack initialRouteName = { "index" } screenOptions = { { contentStyle : { backgroundColor : "#17171d" } , headerShown : false , animation : "fade" } } >
14+ </ Stack >
15+ { /* </UserDataProvider> */ }
1816 </ ModalProvider >
1917 ) ;
2018}
Original file line number Diff line number Diff line change @@ -4,30 +4,30 @@ import { Text, View } from "react-native";
44
55// firebase stuff
66import { auth } from "@auth/firebase" ;
7- import { onAuthStateChanged , User } from "firebase/auth" ;
7+ import { onAuthStateChanged } from "firebase/auth" ;
88
99//react and expo
1010import { useEffect , useState } from 'react' ;
1111
1212export default function RootPage ( ) {
1313 // handling loading state
1414 const router = useRouter ( ) ;
15- const [ user , setUser ] = useState < User | null > ( null ) ;
15+ // const [user, setUser] = useState<User | null>(null);
1616 const [ loading , setLoading ] = useState ( true ) ;
1717
1818 useEffect ( ( ) => {
1919 const unsubscribe = onAuthStateChanged ( auth , ( currentUser ) => {
20- setUser ( currentUser ) ;
20+ // setUser(currentUser);
2121 setLoading ( false ) ;
2222 } ) ;
2323 return ( ) => unsubscribe ( ) ;
2424 } , [ ] )
2525
2626 useEffect ( ( ) => {
27- if ( ! user && ! loading ) {
27+ if ( ! loading ) {
2828 router . replace ( "/auth/login" ) ;
2929 }
30- } , [ loading , user ] )
30+ } , [ loading ] )
3131
3232 if ( loading ) {
3333 return (
You can’t perform that action at this time.
0 commit comments