diff options
author | Ivan Chen <ivan@tagg.id> | 2021-04-07 13:14:36 -0400 |
---|---|---|
committer | Ivan Chen <ivan@tagg.id> | 2021-04-07 13:14:36 -0400 |
commit | f36ce8993d45ed69845a2ff6340f4d52d03855d9 (patch) | |
tree | 2c2acec3adfeda204c0b48eb7c7b22a7802780eb /src/components/profile/Friends.tsx | |
parent | 4b0e55cd751bd77e05b8158177a74bd190974218 (diff) | |
parent | a3abb3abe322ea84306e1a12cec46972a81a37de (diff) |
Merge branch 'master' into chat-poc
# Conflicts:
# src/components/profile/Content.tsx
# src/components/taggs/TaggsBar.tsx
# src/screens/profile/ProfileScreen.tsx
# src/types/types.ts
Diffstat (limited to 'src/components/profile/Friends.tsx')
-rw-r--r-- | src/components/profile/Friends.tsx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/components/profile/Friends.tsx b/src/components/profile/Friends.tsx index 44f6bb48..c1dca755 100644 --- a/src/components/profile/Friends.tsx +++ b/src/components/profile/Friends.tsx @@ -27,7 +27,7 @@ interface FriendsProps { const Friends: React.FC<FriendsProps> = ({result, screenType, userId}) => { const state: RootState = useStore().getState(); const dispatch = useDispatch(); - const {user: loggedInUser = NO_USER} = state; + const {user: loggedInUser = NO_USER} = state.user; const navigation = useNavigation(); const [usersFromContacts, setUsersFromContacts] = useState< ProfilePreviewType[] @@ -39,7 +39,7 @@ const Friends: React.FC<FriendsProps> = ({result, screenType, userId}) => { const permission = await checkPermission(); if (permission === 'authorized') { let response = await usersFromContactsService(contacts); - await setUsersFromContacts(response.existing_tagg_users); + setUsersFromContacts(response.existing_tagg_users); } else { console.log('Authorize access to contacts'); } @@ -84,10 +84,10 @@ const Friends: React.FC<FriendsProps> = ({result, screenType, userId}) => { return ( <> - {loggedInUser.userId === userId && ( + {loggedInUser.userId === userId && usersFromContacts.length !== 0 && ( <View style={styles.subheader}> <View style={styles.addFriendHeaderContainer}> - <Text style={[styles.subheaderText]}>Contacts on tagg</Text> + <Text style={[styles.subheaderText]}>Contacts on Tagg</Text> </View> <UsersFromContacts /> </View> |