diff options
-rw-r--r-- | src/screens/profile/EditProfile.tsx | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/screens/profile/EditProfile.tsx b/src/screens/profile/EditProfile.tsx index dfb8ba1f..dd491f81 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} = route.params; + const {userId, username} = route.params; const { profile: {website, biography, gender, snapchat, tiktok, university_class}, avatar, @@ -74,12 +74,10 @@ 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, user]); + }, [dispatch, needsUpdate, userId, username]); const [isCustomGender, setIsCustomGender] = React.useState<boolean>( gender !== '' && gender !== 'female' && gender !== 'male', @@ -116,7 +114,7 @@ const EditProfile: React.FC<EditProfileProps> = ({route, navigation}) => { <TouchableOpacity accessible={true} accessibilityLabel="ADD HEADER IMAGE" - onPress={goToGalleryLargePic} + onPress={() => goToGalleryLargePic()} style={styles.largeProfileUploader}> {form.largePic ? ( <Image @@ -136,7 +134,7 @@ const EditProfile: React.FC<EditProfileProps> = ({route, navigation}) => { <TouchableOpacity accessible={true} accessibilityLabel="ADD PROFILE PICTURE" - onPress={goToGallerySmallPic} + onPress={() => goToGallerySmallPic()} style={styles.smallProfileUploader}> {form.smallPic ? ( <Image |