Node.js based forum software built for the modern web
feat: show ignored/watched topics in topic list, closes #10974
Barış Soner Uşaklı29dbe92d6efd
diff --git a/install/package.json b/install/package.jsonindex 926c7532e3..fcfa3e1668 100644--- a/install/package.json+++ b/install/package.json@@ -103,10 +103,10 @@"nodebb-plugin-ntfy": "1.7.4","nodebb-plugin-spam-be-gone": "2.2.2","nodebb-rewards-essentials": "1.0.0",- "nodebb-theme-harmony": "1.2.56",+ "nodebb-theme-harmony": "1.2.57","nodebb-theme-lavender": "7.1.8","nodebb-theme-peace": "2.2.5",- "nodebb-theme-persona": "13.3.19",+ "nodebb-theme-persona": "13.3.20","nodebb-widget-essentials": "7.0.16","nodemailer": "6.9.13","nprogress": "0.2.0",diff --git a/public/openapi/components/schemas/TopicObject.yaml b/public/openapi/components/schemas/TopicObject.yamlindex ad337379f7..ee34558ffc 100644--- a/public/openapi/components/schemas/TopicObject.yaml+++ b/public/openapi/components/schemas/TopicObject.yaml@@ -156,6 +156,8 @@ TopicObject:type: booleanignored:type: boolean+ followed:+ type: booleanunread:type: booleanbookmark:diff --git a/public/openapi/read/unread.yaml b/public/openapi/read/unread.yamlindex e63242729c..307a85b3b6 100644--- a/public/openapi/read/unread.yaml+++ b/public/openapi/read/unread.yaml@@ -176,6 +176,8 @@ get:type: booleanignored:type: boolean+ followed:+ type: booleanunread:type: booleanbookmark:diff --git a/src/topics/index.js b/src/topics/index.jsindex 3d313d08e6..59e731affe 100644--- a/src/topics/index.js+++ b/src/topics/index.js@@ -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));