diff --git a/web/react/components/posts_view.jsx b/web/react/components/posts_view.jsx index 1ea7711eaf2..9a16734837f 100644 --- a/web/react/components/posts_view.jsx +++ b/web/react/components/posts_view.jsx @@ -321,7 +321,7 @@ export default class PostsView extends React.Component { if (this.refs.newMessageSeparator) { var objDiv = this.refs.postlist; objDiv.scrollTop = this.refs.newMessageSeparator.offsetTop; //scrolls node to top of Div - } else { + } else if (this.refs.postlist) { this.refs.postlist.scrollTop = this.refs.postlist.scrollHeight; } }); diff --git a/web/react/components/search_results.jsx b/web/react/components/search_results.jsx index 55ece2c97b9..8985063a078 100644 --- a/web/react/components/search_results.jsx +++ b/web/react/components/search_results.jsx @@ -61,7 +61,15 @@ export default class SearchResults extends React.Component { } shouldComponentUpdate(nextProps, nextState) { - return !Utils.areObjectsEqual(this.props, nextProps) || !Utils.areObjectsEqual(this.state, nextState); + if (!Utils.areObjectsEqual(this.props, nextProps)) { + return true; + } + + if (!Utils.areObjectsEqual(this.state, nextState)) { + return true; + } + + return false; } componentDidUpdate() { @@ -143,13 +151,19 @@ export default class SearchResults extends React.Component { ); } else { ctls = results.order.map(function mymap(id) { - var post = results.posts[id]; + const post = results.posts[id]; + let profile; + if (UserStore.getCurrentId() === post.user_id) { + profile = UserStore.getCurrentUser(); + } else { + profile = profiles[post.user_id]; + } return (