From 72aabf60d815cdecf59aaef86df57be6a557efd0 Mon Sep 17 00:00:00 2001
From: Ashm Walia <ashmwalia@outlook.com>
Date: Fri, 15 Jan 2021 19:04:07 -0800
Subject: Done

---
 src/components/profile/Content.tsx | 25 ++-----------------------
 1 file changed, 2 insertions(+), 23 deletions(-)

(limited to 'src/components/profile/Content.tsx')

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));
   };
 
   /**
-- 
cgit v1.2.3-70-g09d2

