aboutsummaryrefslogtreecommitdiff
path: root/src/screens
diff options
context:
space:
mode:
Diffstat (limited to 'src/screens')
-rw-r--r--src/screens/profile/EditProfile.tsx6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/screens/profile/EditProfile.tsx b/src/screens/profile/EditProfile.tsx
index 26802e45..dfb8ba1f 100644
--- a/src/screens/profile/EditProfile.tsx
+++ b/src/screens/profile/EditProfile.tsx
@@ -61,7 +61,7 @@ interface EditProfileProps {
const EditProfile: React.FC<EditProfileProps> = ({route, navigation}) => {
const y: Animated.Value<number> = Animated.useValue(0);
- const {userId, username} = route.params;
+ const {userId} = route.params;
const {
profile: {website, biography, gender, snapchat, tiktok, university_class},
avatar,
@@ -74,10 +74,12 @@ const EditProfile: React.FC<EditProfileProps> = ({route, navigation}) => {
useEffect(() => {
if (needsUpdate) {
+ const userId = user.userId;
+ const username = user.username;
dispatch(resetHeaderAndProfileImage());
dispatch(loadUserData({userId, username}));
}
- }, [dispatch, needsUpdate, userId, username]);
+ }, [dispatch, needsUpdate, user]);
const [isCustomGender, setIsCustomGender] = React.useState<boolean>(
gender !== '' && gender !== 'female' && gender !== 'male',