mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-08 15:05:46 +01:00
This commit is contained in:
@@ -234,10 +234,13 @@ var social = require('./social');
|
|||||||
function getMainPostAndReplies(topic, set, uid, start, stop, reverse, callback) {
|
function getMainPostAndReplies(topic, set, uid, start, stop, reverse, callback) {
|
||||||
async.waterfall([
|
async.waterfall([
|
||||||
function (next) {
|
function (next) {
|
||||||
if (start > 0 && stop > 0) {
|
if (stop > 0) {
|
||||||
start--;
|
|
||||||
stop--;
|
stop--;
|
||||||
|
if (start > 0) {
|
||||||
|
start --;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
posts.getPidsFromSet(set, start, stop, reverse, next);
|
posts.getPidsFromSet(set, start, stop, reverse, next);
|
||||||
},
|
},
|
||||||
function (pids, next) {
|
function (pids, next) {
|
||||||
@@ -247,7 +250,6 @@ var social = require('./social');
|
|||||||
|
|
||||||
if (topic.mainPid && start === 0) {
|
if (topic.mainPid && start === 0) {
|
||||||
pids.unshift(topic.mainPid);
|
pids.unshift(topic.mainPid);
|
||||||
pids.pop();
|
|
||||||
}
|
}
|
||||||
posts.getPostsByPids(pids, uid, next);
|
posts.getPostsByPids(pids, uid, next);
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user