Loading mobile/src/auth/contexts/auth_context.tsx +32 −26 Original line number Diff line number Diff line Loading @@ -34,6 +34,7 @@ export const AuthContextProvider = ({ children }: AuthContextProviderProps) => { const [isLoading, setIsLoading] = useState(true); const checkSession = async () => { try { const user = await SecureStore.getItemAsync("user"); const token = await SecureStore.getItemAsync("token"); console.log(user); Loading Loading @@ -61,7 +62,12 @@ export const AuthContextProvider = ({ children }: AuthContextProviderProps) => { } axios.defaults.headers.common["Authorization"] = `Bearer ${token}`; } } catch { console.log("Error checking session"); setIsVerified(false); } finally { setIsLoading(false); } }; const verify = async () => { Loading mobile/src/common/contexts/set_up_context.tsx +26 −19 Original line number Diff line number Diff line Loading @@ -48,6 +48,7 @@ export const SetUpContextProvider = ({ ); setIsFirstTime(false); } setIsLoading(false); }; const value = { Loading @@ -58,6 +59,7 @@ export const SetUpContextProvider = ({ useEffect(() => { const checkFirstTime = async () => { try { if (isLoadingUser) return; if (!user) { setIsLoading(false); Loading @@ -78,7 +80,12 @@ export const SetUpContextProvider = ({ JSON.stringify(emptyUserPreferences) ); } } catch { console.log("Error checking session"); setIsFirstTime(true); } finally { setIsLoading(false); } }; checkFirstTime(); Loading Loading
mobile/src/auth/contexts/auth_context.tsx +32 −26 Original line number Diff line number Diff line Loading @@ -34,6 +34,7 @@ export const AuthContextProvider = ({ children }: AuthContextProviderProps) => { const [isLoading, setIsLoading] = useState(true); const checkSession = async () => { try { const user = await SecureStore.getItemAsync("user"); const token = await SecureStore.getItemAsync("token"); console.log(user); Loading Loading @@ -61,7 +62,12 @@ export const AuthContextProvider = ({ children }: AuthContextProviderProps) => { } axios.defaults.headers.common["Authorization"] = `Bearer ${token}`; } } catch { console.log("Error checking session"); setIsVerified(false); } finally { setIsLoading(false); } }; const verify = async () => { Loading
mobile/src/common/contexts/set_up_context.tsx +26 −19 Original line number Diff line number Diff line Loading @@ -48,6 +48,7 @@ export const SetUpContextProvider = ({ ); setIsFirstTime(false); } setIsLoading(false); }; const value = { Loading @@ -58,6 +59,7 @@ export const SetUpContextProvider = ({ useEffect(() => { const checkFirstTime = async () => { try { if (isLoadingUser) return; if (!user) { setIsLoading(false); Loading @@ -78,7 +80,12 @@ export const SetUpContextProvider = ({ JSON.stringify(emptyUserPreferences) ); } } catch { console.log("Error checking session"); setIsFirstTime(true); } finally { setIsLoading(false); } }; checkFirstTime(); Loading