mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-04 21:15: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
@@ -37,7 +37,7 @@ module.exports = function (Topics) {
|
||||
}, next);
|
||||
},
|
||||
function (results, next) {
|
||||
Topics.calculatePostIndices(results.posts, start, stop, results.postCount, reverse);
|
||||
Topics.calculatePostIndices(results.posts, start, results.postCount, reverse);
|
||||
|
||||
Topics.addPostData(results.posts, uid, next);
|
||||
},
|
||||
@@ -183,7 +183,7 @@ module.exports = function (Topics) {
|
||||
], callback);
|
||||
};
|
||||
|
||||
Topics.calculatePostIndices = function (posts, start, stop, postCount, reverse) {
|
||||
Topics.calculatePostIndices = function (posts, start, postCount, reverse) {
|
||||
posts.forEach(function (post, index) {
|
||||
if (reverse) {
|
||||
post.index = postCount - (start + index + 1);
|
||||
|
||||
Reference in New Issue
Block a user