Node.js based forum software built for the modern web
refactor: fix variable name
Barış Soner Uşaklı1982edfde3f4
diff --git a/src/topics/index.js b/src/topics/index.jsindex f687c68cba..bce9bc2fa9 100644--- a/src/topics/index.js+++ b/src/topics/index.js@@ -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;