fix: #8538, go to first unread instead of last read

This commit is contained in:
Barış Soner Uşaklı
2020-07-31 10:34:10 -04:00
parent 029f477434
commit 519e665939
2 changed files with 5 additions and 3 deletions

View File

@@ -119,7 +119,9 @@ Topics.getTopicsByTids = async function (tids, options) {
topic.isOwner = topic.uid === parseInt(uid, 10);
topic.ignored = isIgnored[i];
topic.unread = !hasRead[i] && !isIgnored[i];
topic.bookmark = sortOldToNew ? Math.max(1, topic.postcount + 2 - bookmarks[i]) : bookmarks[i];
topic.bookmark = sortOldToNew ?
Math.max(1, topic.postcount + 2 - bookmarks[i]) :
Math.min(topic.postcount, bookmarks[i] + 1);
topic.unreplied = !topic.teaser;
topic.icons = [];