Commit 94689408 by G

set userInformations when retrieve from api

parent 9ee4e0f4
......@@ -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) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment