Skip to content

Commit bb2e795

Browse files
committed
Removed user context for debugging
1 parent fb08e4a commit bb2e795

2 files changed

Lines changed: 10 additions & 12 deletions

File tree

app/_layout.tsx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
11
// navigation
22
import { Stack } from "expo-router";
33

4-
54
//contexts
65
import { ModalProvider } from "@contexts/modalContext";
7-
import { UserDataProvider } from "@contexts/userContext";
8-
6+
// import { UserDataProvider } from "@contexts/userContext";
97

108
export 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
}

app/index.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,30 +4,30 @@ import { Text, View } from "react-native";
44

55
// firebase stuff
66
import { auth } from "@auth/firebase";
7-
import { onAuthStateChanged, User } from "firebase/auth";
7+
import { onAuthStateChanged } from "firebase/auth";
88

99
//react and expo
1010
import { useEffect, useState } from 'react';
1111

1212
export 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 (

0 commit comments

Comments
 (0)