Skip to content

Node.js based forum software built for the modern web

fix: #9917, show topics as unread for guests

Barış Soner Uşaklı4333d217a1f4
diff --git a/src/topics/index.js b/src/topics/index.js
index 85f9aefb49..85aa31aa2a 100644
--- a/src/topics/index.js
+++ b/src/topics/index.js
@@ -137,7 +137,7 @@ 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.unread = parseInt(uid, 10) <= 0 || (!hasRead[i] && !isIgnored[i]);
topic.bookmark = sortNewToOld ?
Math.max(1, topic.postcount + 2 - bookmarks[i]) :
Math.min(topic.postcount, bookmarks[i] + 1);