diff options
author | Ashm Walia <40498934+ashmgarv@users.noreply.github.com> | 2020-11-02 10:22:16 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-02 13:22:16 -0500 |
commit | c115fd43c8adb31f1266306974711a3bbe18d20c (patch) | |
tree | fa295c211f8505a57ea5089cf5e247cb54346fdd | |
parent | 97a2d354a1cd1d3d50e456d95487614d172417f2 (diff) |
Reflect follow / unfollow on logged in user's profile (#87)
-rw-r--r-- | src/components/profile/Content.tsx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/components/profile/Content.tsx b/src/components/profile/Content.tsx index a0af1e94..f86d8331 100644 --- a/src/components/profile/Content.tsx +++ b/src/components/profile/Content.tsx @@ -24,7 +24,10 @@ const Content: React.FC<ContentProps> = ({y, isProfileView}) => { ? React.useContext(ProfileContext) : React.useContext(AuthContext); const {logout} = React.useContext(AuthContext); - const {user: loggedInUser} = React.useContext(AuthContext); + const { + user: loggedInUser, + updateFollowers: updateLoggedInUserFollowers, + } = React.useContext(AuthContext); /** * States @@ -100,6 +103,7 @@ const Content: React.FC<ContentProps> = ({y, isProfileView}) => { if (isUpdatedSuccessful) { setFollowed(!followed); updateFollowers(true); + updateLoggedInUserFollowers(true); } }; |