From b4254a49ad74c4460889e7172ea3575eda8ef556 Mon Sep 17 00:00:00 2001 From: Brian Kim Date: Wed, 12 May 2021 11:45:03 -0700 Subject: Undid accidental changes to EditProfile.tsx --- src/screens/profile/EditProfile.tsx | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src') 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 = ({route, navigation}) => { const y: Animated.Value = 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 = ({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( gender !== '' && gender !== 'female' && gender !== 'male', @@ -116,7 +114,7 @@ const EditProfile: React.FC = ({route, navigation}) => { goToGalleryLargePic()} style={styles.largeProfileUploader}> {form.largePic ? ( = ({route, navigation}) => { goToGallerySmallPic()} style={styles.smallProfileUploader}> {form.smallPic ? (