From 94689408eea4ab1691a99fb8643b925891492ac4 Mon Sep 17 00:00:00 2001 From: G Date: Mon, 1 Jul 2024 10:27:11 +0000 Subject: [PATCH] set userInformations when retrieve from api --- src/screens/UserLoginScreen.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/screens/UserLoginScreen.tsx b/src/screens/UserLoginScreen.tsx index 88e5c75..0a9ae8c 100644 --- a/src/screens/UserLoginScreen.tsx +++ b/src/screens/UserLoginScreen.tsx @@ -22,7 +22,7 @@ const log = LOG.extend("UserLoginScreen"); const UserLoginScreen: MainStackScreenComponentProps<"userLoginScreen"> = ({ navigation }) => { log.debug("UserLoginScreen"); const insets = useSafeAreaInsets(); - const { setAuthenticationData } = useUserAuthenticationContext(); + const { setAuthenticationData, setUserInformations } = useUserAuthenticationContext(); const [email, setEmail] = useState(""); const [password, setPassword] = useState(""); @@ -56,8 +56,9 @@ const UserLoginScreen: MainStackScreenComponentProps<"userLoginScreen"> = ({ nav const userInformationsMutation = useMutation({ mutationFn: (userAccessToken: string) => getUserInformations(userAccessToken), - onSuccess: (_data) => { + onSuccess: (userInformations) => { log.info("getUserInformations request was a success, navigating to homepage"); + setUserInformations(userInformations); navigation.navigate("appBottomTabsNavigator"); }, onError: (error) => { -- libgit2 0.27.1