aboutsummaryrefslogtreecommitdiff
path: root/src/components/profile/Content.tsx
diff options
context:
space:
mode:
authorAshm Walia <40498934+ashmgarv@users.noreply.github.com>2020-11-09 12:16:44 -0800
committerGitHub <noreply@github.com>2020-11-09 15:16:44 -0500
commitf347ef180ece9235380f2225243beddaececa949 (patch)
tree02ae7739ae16f68fb47a574420c1c497fb5f06ac /src/components/profile/Content.tsx
parentd7ed9541f47c22d93c43a32baf3bf33d68d823c8 (diff)
[FOR MASS REVIEW] Multiple contexts(Searched user gets replaced) (#97)
* First commit towards clean code * Tested things * Some final touch * View updates posts * Cleaned up followers / following * You won't believe but it works * Pass avatar uri via props * Small change * Small change * Removed unnecessary jargon Co-authored-by: Ivan Chen <ivan@thetaggid.com>
Diffstat (limited to 'src/components/profile/Content.tsx')
-rw-r--r--src/components/profile/Content.tsx4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/components/profile/Content.tsx b/src/components/profile/Content.tsx
index f86d8331..7afc3fbc 100644
--- a/src/components/profile/Content.tsx
+++ b/src/components/profile/Content.tsx
@@ -23,6 +23,7 @@ const Content: React.FC<ContentProps> = ({y, isProfileView}) => {
const {user, moments, followers, following, updateFollowers} = isProfileView
? React.useContext(ProfileContext)
: React.useContext(AuthContext);
+
const {logout} = React.useContext(AuthContext);
const {
user: loggedInUser,
@@ -71,7 +72,7 @@ const Content: React.FC<ContentProps> = ({y, isProfileView}) => {
}, [createImagesMap]);
/**
- * This hook is called load of profile and when you push update the followers list.
+ * This hook is called on load of profile and when you update the followers list.
*/
useEffect(() => {
if (!userId) {
@@ -87,6 +88,7 @@ const Content: React.FC<ContentProps> = ({y, isProfileView}) => {
/**
* Handles a click on the follow / unfollow button.
+ * updateFollowers and updateLoggedInUerFollowers to make sure that we update followers list / count for both the users in context.
*/
const handleFollowUnfollow = async () => {
const token = await AsyncStorage.getItem('token');