|
|
|
@ -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;
|
|
|
|
|