From a48e3c5b04f22fdd17b3eb4b8a5857f1dbbf800b Mon Sep 17 00:00:00 2001 From: ccd0 Date: Tue, 2 Apr 2019 01:30:07 -0700 Subject: [PATCH] Account for posts added by thread expansion when marking read from index. --- src/Monitoring/UnreadIndex.coffee | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/Monitoring/UnreadIndex.coffee b/src/Monitoring/UnreadIndex.coffee index 46606aef8..05f0920d7 100644 --- a/src/Monitoring/UnreadIndex.coffee +++ b/src/Monitoring/UnreadIndex.coffee @@ -94,13 +94,10 @@ UnreadIndex = markRead: -> thread = Get.threadFromNode @ - if Index.enabled - lastPost = Index.lastPost(thread.ID) - else - lastPost = 0 - thread.posts.forEach (post) -> - if post.ID > lastPost and !post.isFetchedQuote - lastPost = post.ID + lastPost = if Index.enabled then Index.lastPost(thread.ID) else 0 + thread.posts.forEach (post) -> + if post.ID > lastPost and !post.isFetchedQuote + lastPost = post.ID UnreadIndex.lastReadPost[thread.fullID] = lastPost UnreadIndex.db.set boardID: thread.board.ID