okay to set lastReadPost if entire thread read
This commit is contained in:
parent
3a11045e4c
commit
4662d6e2aa
@ -138,7 +138,7 @@ Unread =
|
|||||||
{ID} = post
|
{ID} = post
|
||||||
{posts} = Unread
|
{posts} = Unread
|
||||||
return unless posts[ID]
|
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.lastReadPost = ID
|
||||||
Unread.saveLastReadPost()
|
Unread.saveLastReadPost()
|
||||||
posts.rm ID
|
posts.rm ID
|
||||||
@ -150,9 +150,11 @@ Unread =
|
|||||||
height = doc.clientHeight
|
height = doc.clientHeight
|
||||||
|
|
||||||
{posts} = Unread
|
{posts} = Unread
|
||||||
|
maxID = 0
|
||||||
while post = posts.first
|
while post = posts.first
|
||||||
break unless Header.getBottomOf(post.data.nodes.root) > -1 # post is not completely read
|
break unless Header.getBottomOf(post.data.nodes.root) > -1 # post is not completely read
|
||||||
{ID, data} = post
|
{ID, data} = post
|
||||||
|
maxID = Math.max maxID, ID
|
||||||
posts.rm ID
|
posts.rm ID
|
||||||
delete Unread.postsQuotingYou[ID]
|
delete Unread.postsQuotingYou[ID]
|
||||||
|
|
||||||
@ -163,10 +165,10 @@ Unread =
|
|||||||
}
|
}
|
||||||
QuoteYou.lastRead = data.nodes.root
|
QuoteYou.lastRead = data.nodes.root
|
||||||
|
|
||||||
return unless ID
|
return unless maxID
|
||||||
|
|
||||||
unless QuoteThreading.enabled
|
unless QuoteThreading.enabled and posts.length
|
||||||
Unread.lastReadPost = ID if Unread.lastReadPost < ID or !Unread.lastReadPost
|
Unread.lastReadPost = maxID if Unread.lastReadPost < maxID or !Unread.lastReadPost
|
||||||
Unread.saveLastReadPost()
|
Unread.saveLastReadPost()
|
||||||
Unread.update() if e
|
Unread.update() if e
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user