From 7beaf4902813eafe32feb2cb3b775dd3522a8ebf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Mon, 12 Oct 2020 15:16:58 -0400 Subject: [PATCH] feat: set unread false for guests --- src/topics/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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);