summaryrefslogtreecommitdiffstats
path: root/webapp
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2016-11-10 09:25:43 -0500
committerHarrison Healey <harrisonmhealey@gmail.com>2016-11-10 09:25:43 -0500
commit2fdb33042a118831de60d96e7138209e973e0d65 (patch)
tree59ae549e71e6573f63bcf21eb94c5031e3ea5245 /webapp
parent41b31b4c92932a74bb8cc9fbe6b64d327d903a37 (diff)
downloadchat-2fdb33042a118831de60d96e7138209e973e0d65.tar.gz
chat-2fdb33042a118831de60d96e7138209e973e0d65.tar.bz2
chat-2fdb33042a118831de60d96e7138209e973e0d65.zip
Load profiles for search results (#4519)
Diffstat (limited to 'webapp')
-rw-r--r--webapp/actions/post_actions.jsx2
-rw-r--r--webapp/components/search_bar.jsx3
2 files changed, 4 insertions, 1 deletions
diff --git a/webapp/actions/post_actions.jsx b/webapp/actions/post_actions.jsx
index c2cc211b7..9599a9a77 100644
--- a/webapp/actions/post_actions.jsx
+++ b/webapp/actions/post_actions.jsx
@@ -232,7 +232,7 @@ export function loadPostsAfter(postId, offset, numPost, isPost) {
);
}
-function loadProfilesForPosts(posts) {
+export function loadProfilesForPosts(posts) {
const profilesToLoad = {};
for (const pid in posts) {
if (!posts.hasOwnProperty(pid)) {
diff --git a/webapp/components/search_bar.jsx b/webapp/components/search_bar.jsx
index 5cc0e7c23..3ddc192d9 100644
--- a/webapp/components/search_bar.jsx
+++ b/webapp/components/search_bar.jsx
@@ -13,6 +13,7 @@ import SearchSuggestionList from './suggestion/search_suggestion_list.jsx';
import SearchUserProvider from './suggestion/search_user_provider.jsx';
import * as Utils from 'utils/utils.jsx';
import Constants from 'utils/constants.jsx';
+import {loadProfilesForPosts} from 'actions/post_actions.jsx';
import {FormattedMessage, FormattedHTMLMessage} from 'react-intl';
@@ -129,6 +130,8 @@ export default class SearchBar extends React.Component {
results: data,
is_mention_search: isMentionSearch
});
+
+ loadProfilesForPosts(data.posts);
},
(err) => {
this.setState({isSearching: false});