mirror of
https://github.com/urosran/cally.git
synced 2025-11-26 00:24:53 +00:00
Fix profile type
This commit is contained in:
@ -5,7 +5,11 @@ import {useRouter} from "expo-router";
|
||||
import firestore from "@react-native-firebase/firestore";
|
||||
import {UserProfile} from "@/hooks/firebase/types/profileTypes";
|
||||
|
||||
export enum ProfileType { "parent", "child", "caregiver" }
|
||||
export enum ProfileType {
|
||||
"PARENT" = "parent",
|
||||
"CHILD" = "child",
|
||||
"CAREGIVER" = "caregiver"
|
||||
}
|
||||
|
||||
interface IAuthContext {
|
||||
user: FirebaseAuthTypes.User | null,
|
||||
@ -37,7 +41,7 @@ export const AuthContextProvider: FC<{ children: ReactNode }> = ({children}) =>
|
||||
.doc(user.uid)
|
||||
.get();
|
||||
if (documentSnapshot.exists) {
|
||||
setProfileType(documentSnapshot.data()?.profileType);
|
||||
setProfileType(documentSnapshot.data()?.userType);
|
||||
setProfileData(documentSnapshot.data() as UserProfile)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user