diff options
author | Brian Kim <brian@tagg.id> | 2021-05-12 11:45:03 -0700 |
---|---|---|
committer | Brian Kim <brian@tagg.id> | 2021-05-12 11:45:03 -0700 |
commit | b4254a49ad74c4460889e7172ea3575eda8ef556 (patch) | |
tree | a2d4a76001af01e08438e2eddaa8e4151b196fb4 | |
parent | 0e1f57be13b282b516f1bf690f2890b9eabf3188 (diff) |
Undid accidental changes to EditProfile.tsx
-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 |