summaryrefslogtreecommitdiffstats
path: root/webapp/components/search_results.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'webapp/components/search_results.jsx')
-rw-r--r--webapp/components/search_results.jsx6
1 files changed, 5 insertions, 1 deletions
diff --git a/webapp/components/search_results.jsx b/webapp/components/search_results.jsx
index 682b04e2a..64e5a7c93 100644
--- a/webapp/components/search_results.jsx
+++ b/webapp/components/search_results.jsx
@@ -267,7 +267,7 @@ export default class SearchResults extends React.Component {
</div>
);
} else {
- ctls = results.order.map(function mymap(id) {
+ ctls = results.order.map(function searchResults(id, idx, arr) {
const post = results.posts[id];
let profile;
if (UserStore.getCurrentId() === post.user_id) {
@@ -285,12 +285,16 @@ export default class SearchResults extends React.Component {
if (this.state.flaggedPosts) {
isFlagged = this.state.flaggedPosts.get(post.id) === 'true';
}
+
+ const reverseCount = arr.length - idx - 1;
+
return (
<SearchResultsItem
key={post.id}
channel={this.state.channels.get(post.channel_id)}
compactDisplay={this.state.compactDisplay}
post={post}
+ lastPostCount={(reverseCount >= 0 && reverseCount < Constants.TEST_ID_COUNT) ? reverseCount : -1}
user={profile}
term={searchTerm}
isMentionSearch={this.props.isMentionSearch}