Quick fix for issues on lainchan due to not accounting for post container.
This commit is contained in:
parent
983432d261
commit
9fd5a88242
@ -56,7 +56,7 @@ UnreadIndex =
|
|||||||
repliesRead = 0
|
repliesRead = 0
|
||||||
firstUnread = null
|
firstUnread = null
|
||||||
thread.posts.forEach (post) ->
|
thread.posts.forEach (post) ->
|
||||||
if post.isReply and post.nodes.root.parentNode is thread.nodes.root
|
if post.isReply and thread.nodes.root.contains(post.nodes.root)
|
||||||
repliesShown++
|
repliesShown++
|
||||||
if post.ID <= lastReadPost
|
if post.ID <= lastReadPost
|
||||||
repliesRead++
|
repliesRead++
|
||||||
|
|||||||
@ -379,7 +379,7 @@ Main =
|
|||||||
addThreads: (records) ->
|
addThreads: (records) ->
|
||||||
threadRoots = []
|
threadRoots = []
|
||||||
for record in records
|
for record in records
|
||||||
for node in record.addedNodes when node.matches(Site.selectors.thread)
|
for node in record.addedNodes when node.nodeType is Node.ELEMENT_NODE and node.matches(Site.selectors.thread)
|
||||||
threadRoots.push node
|
threadRoots.push node
|
||||||
return unless threadRoots.length
|
return unless threadRoots.length
|
||||||
threads = []
|
threads = []
|
||||||
@ -398,8 +398,12 @@ Main =
|
|||||||
errors = []
|
errors = []
|
||||||
for record in records
|
for record in records
|
||||||
thread = Get.threadFromRoot record.target
|
thread = Get.threadFromRoot record.target
|
||||||
|
postRoots = []
|
||||||
|
for node in record.addedNodes when node.nodeType is Node.ELEMENT_NODE
|
||||||
|
if node.matches(Site.selectors.postContainer) or (node = $(Site.selectors.postContainer, node))
|
||||||
|
postRoots.push node
|
||||||
n = posts.length
|
n = posts.length
|
||||||
Main.parsePosts record.addedNodes, thread, posts, errors
|
Main.parsePosts postRoots, thread, posts, errors
|
||||||
if posts.length > n and thread not in threads
|
if posts.length > n and thread not in threads
|
||||||
threads.push thread
|
threads.push thread
|
||||||
anyRemoved = false
|
anyRemoved = false
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user