Fix update of thread watcher highlight on scroll.
Fixes bug from b9dea6f93165f8d3f277177cf222111373d89e20. Also make quotesYou proper boolean.
This commit is contained in:
parent
12fde7365e
commit
2aca3b1986
@ -238,7 +238,8 @@ ThreadWatcher =
|
|||||||
threadID: threadID
|
threadID: threadID
|
||||||
defaultValue: 0
|
defaultValue: 0
|
||||||
|
|
||||||
unread = quotingYou = 0
|
unread = 0
|
||||||
|
quotingYou = false
|
||||||
youOP = !!QuoteYou.db?.get {boardID, threadID, postID: threadID}
|
youOP = !!QuoteYou.db?.get {boardID, threadID, postID: threadID}
|
||||||
|
|
||||||
for postObj in @response.posts
|
for postObj in @response.posts
|
||||||
@ -248,7 +249,7 @@ ThreadWatcher =
|
|||||||
unread++
|
unread++
|
||||||
|
|
||||||
if !quotingYou and youOP and not Filter.isHidden(Build.parseJSON postObj, boardID)
|
if !quotingYou and youOP and not Filter.isHidden(Build.parseJSON postObj, boardID)
|
||||||
quotingYou = 1
|
quotingYou = true
|
||||||
continue
|
continue
|
||||||
|
|
||||||
continue unless !quotingYou and QuoteYou.db and postObj.com
|
continue unless !quotingYou and QuoteYou.db and postObj.com
|
||||||
@ -264,7 +265,7 @@ ThreadWatcher =
|
|||||||
quotesYou = true
|
quotesYou = true
|
||||||
break
|
break
|
||||||
if quotesYou and not Filter.isHidden(Build.parseJSON postObj, boardID)
|
if quotesYou and not Filter.isHidden(Build.parseJSON postObj, boardID)
|
||||||
quotingYou++
|
quotingYou = true
|
||||||
|
|
||||||
if isDead isnt data.isDead or unread isnt data.unread or quotingYou isnt data.quotingYou
|
if isDead isnt data.isDead or unread isnt data.unread or quotingYou isnt data.quotingYou
|
||||||
ThreadWatcher.db.extend {boardID, threadID, val: {isDead, unread, quotingYou}}
|
ThreadWatcher.db.extend {boardID, threadID, val: {isDead, unread, quotingYou}}
|
||||||
|
|||||||
@ -238,4 +238,4 @@ Unread =
|
|||||||
ThreadWatcher.update Unread.thread.board.ID, Unread.thread.ID,
|
ThreadWatcher.update Unread.thread.board.ID, Unread.thread.ID,
|
||||||
isDead: Unread.thread.isDead
|
isDead: Unread.thread.isDead
|
||||||
unread: Unread.posts.size
|
unread: Unread.posts.size
|
||||||
quotingYou: Unread.postsQuotingYou.size
|
quotingYou: !!(if QuoteYou.isYou(Unread.thread.OP) then Unread.posts.size else Unread.postsQuotingYou.size)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user