mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
refactor: fix variable name
This commit is contained in:
@@ -111,7 +111,7 @@ Topics.getTopicsByTids = async function (tids, options) {
|
||||
user.getSettings(uid),
|
||||
]);
|
||||
|
||||
const sortOldToNew = callerSettings.topicPostSort === 'newest_to_oldest';
|
||||
const sortNewToOld = callerSettings.topicPostSort === 'newest_to_oldest';
|
||||
result.topics.forEach((topic, i) => {
|
||||
if (topic) {
|
||||
topic.thumbs = result.thumbs[i];
|
||||
@@ -127,7 +127,7 @@ Topics.getTopicsByTids = async function (tids, options) {
|
||||
topic.isOwner = topic.uid === parseInt(uid, 10);
|
||||
topic.ignored = isIgnored[i];
|
||||
topic.unread = parseInt(uid, 10) > 0 && !hasRead[i] && !isIgnored[i];
|
||||
topic.bookmark = sortOldToNew ?
|
||||
topic.bookmark = sortNewToOld ?
|
||||
Math.max(1, topic.postcount + 2 - bookmarks[i]) :
|
||||
Math.min(topic.postcount, bookmarks[i] + 1);
|
||||
topic.unreplied = !topic.teaser;
|
||||
|
||||
Reference in New Issue
Block a user