also fix reverse infinite scroll when sorting is changed
This commit is contained in:
Baris Usakli
2017-06-06 16:40:32 -04:00
parent 1d26fc0d89
commit 037a0e5239
8 changed files with 150 additions and 92 deletions

View File

@@ -35,17 +35,13 @@ Categories.getCategoryById = function (data, callback) {
return next(new Error('[[error:invalid-cid]]'));
}
category = categories[0];
data.category = category;
async.parallel({
topics: function (next) {
Categories.getCategoryTopics(data, next);
},
topicCount: function (next) {
if (Array.isArray(data.set)) {
db.sortedSetIntersectCard(data.set, next);
} else {
next(null, category.topic_count);
}
Categories.getTopicCount(data, next);
},
isIgnored: function (next) {
Categories.isIgnored([data.cid], data.uid, next);