Node.js based forum software built for the modern web
fix: #8538, go to first unread instead of last read
Barış Soner Uşaklı519e665939ba
diff --git a/public/src/client/topic.js b/public/src/client/topic.jsindex 00e69eb65a..9243ac05b7 100644--- a/public/src/client/topic.js+++ b/public/src/client/topic.js@@ -136,7 +136,7 @@ define('forum/topic', [timeout: 0,type: 'info',clickfn: function () {- navigator.scrollToIndex(parseInt(bookmark - 1, 10), true);+ navigator.scrollToIndex(parseInt(bookmark, 10), true);},closefn: function () {storage.removeItem('topic:' + tid + ':bookmark');@@ -259,7 +259,7 @@ define('forum/topic', [if (err) {return app.alertError(err.message);}- ajaxify.data.bookmark = index;+ ajaxify.data.bookmark = index + 1;});} else {storage.setItem(bookmarkKey, index);diff --git a/src/topics/index.js b/src/topics/index.jsindex 23a578baec..a80be8b1cf 100644--- a/src/topics/index.js+++ b/src/topics/index.js@@ -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 = [];