aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Kim <brian@tagg.id>2021-05-12 11:45:03 -0700
committerBrian Kim <brian@tagg.id>2021-05-12 11:45:03 -0700
commitb4254a49ad74c4460889e7172ea3575eda8ef556 (patch)
treea2d4a76001af01e08438e2eddaa8e4151b196fb4
parent0e1f57be13b282b516f1bf690f2890b9eabf3188 (diff)
Undid accidental changes to EditProfile.tsx
-rw-r--r--src/screens/profile/EditProfile.tsx10
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