From 4662d6e2aa9ff3c6cf5268022ae36089ea23831e Mon Sep 17 00:00:00 2001 From: ccd0 Date: Sun, 1 Jun 2014 22:25:04 -0700 Subject: [PATCH] okay to set lastReadPost if entire thread read --- src/Monitoring/Unread.coffee | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Monitoring/Unread.coffee b/src/Monitoring/Unread.coffee index 0465335d1..03ff247b0 100755 --- a/src/Monitoring/Unread.coffee +++ b/src/Monitoring/Unread.coffee @@ -138,7 +138,7 @@ Unread = {ID} = post {posts} = Unread return unless posts[ID] - if post is posts.first and !QuoteThreading.enabled + if post is posts.first and !(QuoteThreading.enabled and Unread.posts.length) Unread.lastReadPost = ID Unread.saveLastReadPost() posts.rm ID @@ -150,9 +150,11 @@ Unread = height = doc.clientHeight {posts} = Unread + maxID = 0 while post = posts.first break unless Header.getBottomOf(post.data.nodes.root) > -1 # post is not completely read {ID, data} = post + maxID = Math.max maxID, ID posts.rm ID delete Unread.postsQuotingYou[ID] @@ -163,10 +165,10 @@ Unread = } QuoteYou.lastRead = data.nodes.root - return unless ID + return unless maxID - unless QuoteThreading.enabled - Unread.lastReadPost = ID if Unread.lastReadPost < ID or !Unread.lastReadPost + unless QuoteThreading.enabled and posts.length + Unread.lastReadPost = maxID if Unread.lastReadPost < maxID or !Unread.lastReadPost Unread.saveLastReadPost() Unread.update() if e