diff options
Diffstat (limited to 'src/components/profile/ProfilePreview.tsx')
-rw-r--r-- | src/components/profile/ProfilePreview.tsx | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/components/profile/ProfilePreview.tsx b/src/components/profile/ProfilePreview.tsx index 93d1f415..9dd03c54 100644 --- a/src/components/profile/ProfilePreview.tsx +++ b/src/components/profile/ProfilePreview.tsx @@ -17,8 +17,8 @@ import {UserType, PreviewType} from '../../types'; import {isUserBlocked} from '../../services'; import {useSelector, useDispatch, useStore} from 'react-redux'; import {RootState} from '../../store/rootreducer'; -import {loadUserX, logout} from '../../store/actions'; -import {userXInStore} from '../../utils'; +import {logout} from '../../store/actions'; +import {fetchUserX, userXInStore} from '../../utils'; const NO_USER: UserType = { userId: '', username: '', @@ -157,8 +157,10 @@ const ProfilePreview: React.FC<ProfilePreviewProps> = ({ * Finally, Navigate to profile of the user selected */ if (!userXInStore(state, screenType, user.id)) { - dispatch( - loadUserX({userId: user.id, username: user.username}, screenType), + await fetchUserX( + dispatch, + {userId: user.id, username: user.username}, + screenType, ); } navigation.push('Profile', { @@ -244,7 +246,6 @@ const ProfilePreview: React.FC<ProfilePreviewProps> = ({ )} {previewType === 'Discover Users' && ( <> - <Text style={nameStyle}>{first_name.concat(' ', last_name)}</Text> <Text style={usernameStyle}>{usernameToDisplay}</Text> </> )} |