mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-09-04 07:02:32 +02:00
feat: show ignored/watched topics in topic list, closes #10974
This commit is contained in:
@@ -116,10 +116,10 @@ Topics.getTopicsByTids = async function (tids, options) {
|
||||
};
|
||||
}
|
||||
|
||||
const [result, hasRead, isIgnored, bookmarks, callerSettings] = await Promise.all([
|
||||
const [result, hasRead, followData, bookmarks, callerSettings] = await Promise.all([
|
||||
loadTopics(),
|
||||
Topics.hasReadTopics(tids, uid),
|
||||
Topics.isIgnoring(tids, uid),
|
||||
Topics.getFollowData(tids, uid),
|
||||
Topics.getUserBookmarks(tids, uid),
|
||||
user.getSettings(uid),
|
||||
]);
|
||||
@@ -136,8 +136,9 @@ Topics.getTopicsByTids = async function (tids, options) {
|
||||
}
|
||||
topic.teaser = result.teasers[i] || null;
|
||||
topic.isOwner = topic.uid === parseInt(uid, 10);
|
||||
topic.ignored = isIgnored[i];
|
||||
topic.unread = parseInt(uid, 10) <= 0 || (!hasRead[i] && !isIgnored[i]);
|
||||
topic.ignored = followData[i].ignoring;
|
||||
topic.followed = followData[i].following;
|
||||
topic.unread = parseInt(uid, 10) <= 0 || (!hasRead[i] && !topic.ignored[i]);
|
||||
topic.bookmark = bookmarks[i] && (sortNewToOld ?
|
||||
Math.max(1, topic.postcount + 2 - bookmarks[i]) :
|
||||
Math.min(topic.postcount, bookmarks[i] + 1));
|
||||
|
||||
Reference in New Issue
Block a user