From 88fb33d1fe1cd0785e4a92cb3c20d0fafb2da54d Mon Sep 17 00:00:00 2001 From: Ashm Walia <40498934+ashmgarv@users.noreply.github.com> Date: Mon, 19 Oct 2020 17:14:37 -0700 Subject: Merged changes to make sure moments view and search work (#62) --- src/components/search/SearchResult.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/components/search') 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 = ({ style, }) => { const navigation = useNavigation(); - const {loadProfile} = useContext(ProfileContext); + const {loadProfile, updateMoments} = useContext(ProfileContext); const [avatarURI, setAvatarURI] = useState(null); const [user, setUser] = useState(NO_USER); useEffect(() => { @@ -100,10 +100,12 @@ const SearchResult: React.FC = ({ 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, }); -- cgit v1.2.3-70-g09d2