Skip to content

Node.js based forum software built for the modern web

feat: set unread false for guests

Barış Soner Uşaklı7beaf4902813
diff --git a/src/topics/index.js b/src/topics/index.js
index 74e0395e85..3ed54ce0e8 100644
--- a/src/topics/index.js
+++ b/src/topics/index.js
@@ -118,7 +118,7 @@ Topics.getTopicsByTids = async function (tids, options) {
topic.isOwner = topic.uid === parseInt(uid, 10);
topic.ignored = isIgnored[i];
- topic.unread = !hasRead[i] && !isIgnored[i];
+ topic.unread = parseInt(uid, 10) > 0 && !hasRead[i] && !isIgnored[i];
topic.bookmark = sortOldToNew ?
Math.max(1, topic.postcount + 2 - bookmarks[i]) :
Math.min(topic.postcount, bookmarks[i] + 1);