You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The AuthContextProvider.tsx uses a react useCallback hook for the getUser functon. Look into if this is an issue with how we have things structured or if this is okay to have:
/**
* Get user data from the session
* @returns {Promise<void>}
*/
const getUser = useCallback(async () => {
if (!isSessionInLocalStorage()) {
router.push('/login');
return;
}
try {
const user = await account.get();
const userData: IUser = await getCurrentUser(user.$id);
updateUser(userData.id, userData.email, userData.leagues);
return userData;
} catch (error) {
resetUser();
setIsSignedIn(false);
throw new Error('Error getting user data');
}
}, [updateUser, resetUser, setIsSignedIn, user]);
The text was updated successfully, but these errors were encountered:
The
AuthContextProvider.tsx
uses a reactuseCallback
hook for thegetUser
functon. Look into if this is an issue with how we have things structured or if this is okay to have:The text was updated successfully, but these errors were encountered: