fix double thread insertion bugs in infinite scrolling

This commit is contained in:
ccd0 2014-07-08 08:09:51 -07:00
parent 978cd27ea3
commit 5bb988dee5

View File

@ -111,10 +111,11 @@ Index =
return if Index.req or Conf['Index Mode'] isnt 'infinite' or (window.scrollY <= doc.scrollHeight - (300 + window.innerHeight))
Index.pageNum = Index.getCurrentPage() unless Index.pageNum? # Avoid having to pushState to keep track of the current page
pageNum = Index.pageNum++
pageNum = ++Index.pageNum
return Index.endNotice() if pageNum > Index.pagesNum
nodes = Index.buildSinglePage pageNum
nodes.shift() # Remove thread common with previous page
Index.buildReplies nodes if Conf['Show Replies']
Index.buildStructure nodes
Index.setPage pageNum