inf scroll changes

dont load main post if start > 0
This commit is contained in:
barisusakli
2015-09-24 21:14:34 -04:00
parent 137f2097db
commit c617a3f008
9 changed files with 127 additions and 153 deletions

View File

@@ -266,7 +266,7 @@ var async = require('async'),
return callback(null, []);
}
if (topic.mainPid) {
if (topic.mainPid && start === 0) {
pids.unshift(topic.mainPid);
}
posts.getPostsByPids(pids, uid, next);
@@ -276,7 +276,7 @@ var async = require('async'),
return next(null, []);
}
var replies = posts;
if (topic.mainPid) {
if (topic.mainPid && start === 0) {
posts[0].index = 0;
replies = posts.slice(1);
}