fix recent replies

This commit is contained in:
barisusakli
2015-02-04 15:49:08 -05:00
parent 385760bdda
commit 39a75ea2d7
2 changed files with 5 additions and 2 deletions

View File

@@ -103,7 +103,10 @@ module.exports = function(Categories) {
pids = pids.concat(topicPids).filter(function(pid, index, array) {
return !!pid && array.indexOf(pid) === index;
});
}).sort(function(a, b) {
return b - a;
}).slice(0, count);
callback(null, pids);
});
});

View File

@@ -177,7 +177,7 @@ module.exports = function(Topics) {
return next(err);
}
latestPid = pids[0];
isDeleted = deleted;
isDeleted = parseInt(deleted, 10) === 1;
++index;
next();
});