From e1c3bc9713625fc98fd3f0704545351bd5c82948 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Wed, 8 Oct 2014 19:28:36 -0400 Subject: [PATCH] fix teasers --- src/topics.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/topics.js b/src/topics.js index df68ec8514..26a68d7402 100644 --- a/src/topics.js +++ b/src/topics.js @@ -394,14 +394,16 @@ var async = require('async'), users[user.uid] = user; }); var tidToPost = {}; - postData.forEach(function(post, index) { + postData.forEach(function(post) { post.user = users[post.uid]; - post.index = results.counts[index] + 1; post.timestamp = utils.toISOString(post.timestamp); tidToPost[post.tid] = post; }); - var teasers = tids.map(function(tid) { + var teasers = tids.map(function(tid, index) { + if (tidToPost[tid]) { + tidToPost[tid].index = results.counts[index] + 1; + } return tidToPost[tid]; });