Load profiles for search results (#4519)

Этот коммит содержится в:
Joram Wilander
2016-11-10 09:25:43 -05:00
коммит произвёл Harrison Healey
родитель 41b31b4c92
Коммит 2fdb33042a
2 изменённых файлов: 4 добавлений и 1 удалений

Просмотреть файл

@@ -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)) {

Просмотреть файл

@@ -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});