mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-05 05:25:49 +01:00
Recent refactor (#6879)
* wip * fix inf scroll * remove duplicated code * remove dupe code in /unread * use topicList * update tag page to use topicList * fix tests * combine ifs * remove more dupe code * disable timeout
This commit is contained in:
committed by
GitHub
parent
aa301f27a1
commit
c27be9db5a
@@ -22,16 +22,13 @@ module.exports = function (Categories) {
|
||||
topics.getTopicsByTids(tids, data.uid, next);
|
||||
},
|
||||
async.apply(user.blocks.filter, data.uid),
|
||||
function (topics, next) {
|
||||
if (!topics.length) {
|
||||
function (topicsData, next) {
|
||||
if (!topicsData.length) {
|
||||
return next(null, { topics: [], uid: data.uid });
|
||||
}
|
||||
topics.calculateTopicIndices(topicsData, data.start);
|
||||
|
||||
for (var i = 0; i < topics.length; i += 1) {
|
||||
topics[i].index = data.start + i;
|
||||
}
|
||||
|
||||
plugins.fireHook('filter:category.topics.get', { cid: data.cid, topics: topics, uid: data.uid }, next);
|
||||
plugins.fireHook('filter:category.topics.get', { cid: data.cid, topics: topicsData, uid: data.uid }, next);
|
||||
},
|
||||
function (results, next) {
|
||||
next(null, { topics: results.topics, nextStart: data.stop + 1 });
|
||||
|
||||
Reference in New Issue
Block a user