mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-03-04 11:31:23 +01:00
fixed #889
This commit is contained in:
@@ -136,16 +136,23 @@ var db = require('./database'),
|
||||
topics.getTopicsByTids(tids, cid, uid, next);
|
||||
},
|
||||
function(topics, next) {
|
||||
db.sortedSetRevRank('categories:' + cid + ':tid', topics[topics.length - 1].tid, function(err, rank) {
|
||||
if(err) {
|
||||
return next(err);
|
||||
}
|
||||
if (topics && topics.length > 0) {
|
||||
db.sortedSetRevRank('categories:' + cid + ':tid', topics[topics.length - 1].tid, function(err, rank) {
|
||||
if(err) {
|
||||
return next(err);
|
||||
}
|
||||
|
||||
return next(null, {
|
||||
topics: topics,
|
||||
nextStart: parseInt(rank, 10) + 1
|
||||
next(null, {
|
||||
topics: topics,
|
||||
nextStart: parseInt(rank, 10) + 1
|
||||
});
|
||||
});
|
||||
});
|
||||
} else {
|
||||
next(null, {
|
||||
topics: topics,
|
||||
nextStart: 1
|
||||
});
|
||||
}
|
||||
}
|
||||
], callback);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user