diff options
| author | Brian Kim <brian@tagg.id> | 2021-05-12 11:42:14 -0700 |
|---|---|---|
| committer | Brian Kim <brian@tagg.id> | 2021-05-12 11:42:14 -0700 |
| commit | 0e1f57be13b282b516f1bf690f2890b9eabf3188 (patch) | |
| tree | 32db1d0e8b85986c9bad8e8f5162ce76bb221557 /src/screens | |
| parent | 64971e5d67878ee5bd430dfa89dfe12ac532f5e6 (diff) | |
Plus sign for profile and header in profile, ability to add on the screen, reloads screen, saved to database
Diffstat (limited to 'src/screens')
| -rw-r--r-- | src/screens/profile/EditProfile.tsx | 6 |
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', |
