diff options
author | Ashm Walia <40498934+ashmgarv@users.noreply.github.com> | 2020-10-19 17:14:37 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-19 20:14:37 -0400 |
commit | 88fb33d1fe1cd0785e4a92cb3c20d0fafb2da54d (patch) | |
tree | b2e8d474b2c0b02f4e91cd33fa0d5f9842d3a018 /src/components/search | |
parent | 1b7fef188ec2aee0706fc1204432315db3d4fec6 (diff) |
Merged changes to make sure moments view and search work (#62)
Diffstat (limited to 'src/components/search')
-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, }); |