aboutsummaryrefslogtreecommitdiff
path: root/src/components/profile/Content.tsx
diff options
context:
space:
mode:
authorAshm Walia <ashmwalia@outlook.com>2021-01-15 19:04:07 -0800
committerAshm Walia <ashmwalia@outlook.com>2021-01-15 19:04:07 -0800
commit72aabf60d815cdecf59aaef86df57be6a557efd0 (patch)
tree4fac8f3fe8c44d0730fa3d7707500aa1a68afcd0 /src/components/profile/Content.tsx
parented91266981e1662b512baa1856d8c921a8718e68 (diff)
Done
Diffstat (limited to 'src/components/profile/Content.tsx')
-rw-r--r--src/components/profile/Content.tsx25
1 files changed, 2 insertions, 23 deletions
diff --git a/src/components/profile/Content.tsx b/src/components/profile/Content.tsx
index f7b4b71c..cc9849e6 100644
--- a/src/components/profile/Content.tsx
+++ b/src/components/profile/Content.tsx
@@ -42,6 +42,7 @@ import {
updateUserXFriends,
updateMomentCategories,
deleteUserMomentsForCategory,
+ updateUserXProfileAllScreens,
} from '../../store/actions';
import {
NO_USER,
@@ -214,29 +215,6 @@ const Content: React.FC<ContentProps> = ({y, userXId, screenType}) => {
}
}, [blockedUsers, user]);
- // /**
- // * The object returned by this method is added to the list of blocked / friended users by the reducer.
- // * Which helps us prevent an extra api call to the backend just to fetch a user.
- // */
- // const getUserAsProfilePreviewType = (
- // passedInUser: UserType,
- // passedInProfile: ProfileType,
- // ): ProfilePreviewType => {
- // const fullName = passedInProfile.name.split(' ');
- // return {
- // id: passedInUser.userId,
- // username: passedInUser.username,
- // first_name: fullName[0],
- // last_name: fullName[1],
- // };
- // };
-
- /**
- * Handles a click on the friend / unfriend button.
- * friendUnfriendUser takes care of updating the friends list for loggedInUser
- * updateUserXFriends updates friends list for the new friend.
- */
-
// Handles click on friend/requested/unfriend button
/*
* When user logged in clicks on the friend button:
@@ -259,6 +237,7 @@ const Content: React.FC<ContentProps> = ({y, userXId, screenType}) => {
),
);
await dispatch(updateUserXFriends(user.userId, state));
+ dispatch(updateUserXProfileAllScreens(user.userId, state));
};
/**