mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-21 16:00:26 +01:00
Bookmark optimization (#6315)
* Set the user's bookmark if their current bookmark is past the end of the topic. * Optimize forked topic bookmark updating. Remove support for updating bookmarks for users who sort by votes. Don't even consider updating bookmarks for users who have not read the posts being removed. Only compute post indices once per fork operation instead of once per user that has ever read the topic.
This commit is contained in:
committed by
Barış Soner Uşaklı
parent
7f9d9b7654
commit
00776bdd8e
@@ -231,7 +231,7 @@ define('forum/topic', [
|
||||
var bookmarkKey = 'topic:' + ajaxify.data.tid + ':bookmark';
|
||||
var currentBookmark = ajaxify.data.bookmark || storage.getItem(bookmarkKey);
|
||||
|
||||
if (ajaxify.data.postcount > ajaxify.data.bookmarkThreshold && (!currentBookmark || parseInt(index, 10) > parseInt(currentBookmark, 10))) {
|
||||
if (ajaxify.data.postcount > ajaxify.data.bookmarkThreshold && (!currentBookmark || parseInt(index, 10) > parseInt(currentBookmark, 10) || ajaxify.data.postcount < parseInt(currentBookmark, 10))) {
|
||||
if (app.user.uid) {
|
||||
socket.emit('topics.bookmark', {
|
||||
tid: ajaxify.data.tid,
|
||||
|
||||
Reference in New Issue
Block a user