mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-02 03:55:55 +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
@@ -178,11 +178,17 @@ module.exports = function (Topics) {
|
||||
Topics.getTopicsByTids(tids, params.uid, next);
|
||||
},
|
||||
function (topicData, next) {
|
||||
topicData.forEach(function (topicObj, i) {
|
||||
topicObj.index = params.start + i;
|
||||
});
|
||||
Topics.calculateTopicIndices(topicData, params.start);
|
||||
next(null, topicData);
|
||||
},
|
||||
], callback);
|
||||
}
|
||||
|
||||
Topics.calculateTopicIndices = function (topicData, start) {
|
||||
topicData.forEach((topic, index) => {
|
||||
if (topic) {
|
||||
topic.index = start + index;
|
||||
}
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user