Skip to content

Node.js based forum software built for the modern web

fix: also fix updating bookmark if sorting is newest_to_oldest

Barış Soner Uşaklı6e5de39ba059
diff --git a/public/src/client/topic.js b/public/src/client/topic.js
index a26f9f6a95..cc955f5442 100644
--- a/public/src/client/topic.js
+++ b/public/src/client/topic.js
@@ -241,6 +241,9 @@ define('forum/topic', [
function updateUserBookmark(index) {
var bookmarkKey = 'topic:' + ajaxify.data.tid + ':bookmark';
var currentBookmark = ajaxify.data.bookmark || storage.getItem(bookmarkKey);
+ if (config.topicPostSort === 'newest_to_oldest') {
+ index = Math.max(1, ajaxify.data.postcount - index + 2);
+ }
if (ajaxify.data.postcount > ajaxify.data.bookmarkThreshold && (!currentBookmark || parseInt(index, 10) > parseInt(currentBookmark, 10) || ajaxify.data.postcount < parseInt(currentBookmark, 10))) {
if (app.user.uid) {