diff options
Diffstat (limited to 'src/components/search/SearchResult.tsx')
-rw-r--r-- | src/components/search/SearchResult.tsx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/components/search/SearchResult.tsx b/src/components/search/SearchResult.tsx index cc960308..04624004 100644 --- a/src/components/search/SearchResult.tsx +++ b/src/components/search/SearchResult.tsx @@ -27,7 +27,7 @@ const SearchResult: React.FC<SearchResultProps> = ({ style, }) => { const navigation = useNavigation(); - const {loadProfile} = useContext(ProfileContext); + const {loadProfile, updateMoments} = useContext(ProfileContext); const [avatarURI, setAvatarURI] = useState<string | null>(null); const [user, setUser] = useState<UserType>(NO_USER); useEffect(() => { @@ -100,10 +100,12 @@ const SearchResult: React.FC<SearchResultProps> = ({ recentlySearchedList = [user]; } - //Load user profile and navigate to ProfileView + //Load user profile and set new moments to true, navigate to Profile //Load user profile makes sure that we actually load profile of the user the logged in user want to view + //Set new moments to true makes sure that we download the moment for the user being viewed again. //Not sure if we should make this call before caching the search results ?? loadProfile(user.id, user.username); + updateMoments(true); navigation.navigate('Profile', { isProfileView: true, }); |