Fix and tweak watcher updater after an index refresh.
This commit is contained in:
parent
7e8fd31733
commit
c8f7eef912
@ -169,9 +169,9 @@ Index =
|
|||||||
if Conf['Index Mode'] is 'paged'
|
if Conf['Index Mode'] is 'paged'
|
||||||
pageNum = +window.location.pathname.split('/')[2]
|
pageNum = +window.location.pathname.split('/')[2]
|
||||||
nodesPerPage = Index.threadsNumPerPage * 2
|
nodesPerPage = Index.threadsNumPerPage * 2
|
||||||
nodes = Index.sortedNodes.slice nodesPerPage * pageNum, nodesPerPage * (pageNum + 1)
|
nodes = Index.sortedNodes.slice nodesPerPage * pageNum, nodesPerPage * (pageNum + 1)
|
||||||
else
|
else
|
||||||
nodes = Index.sortedNodes
|
nodes = Index.sortedNodes
|
||||||
$.event 'IndexRefresh'
|
$.event 'IndexRefresh'
|
||||||
$.rmAll Index.root
|
$.rmAll Index.root
|
||||||
$.add Index.root, nodes
|
$.add Index.root, nodes
|
||||||
|
|||||||
@ -74,14 +74,14 @@ ThreadWatcher =
|
|||||||
else if Conf['Auto Watch Reply']
|
else if Conf['Auto Watch Reply']
|
||||||
ThreadWatcher.add board.threads[threadID]
|
ThreadWatcher.add board.threads[threadID]
|
||||||
onIndexRefresh: ->
|
onIndexRefresh: ->
|
||||||
{db} = ThreadWatcher
|
{db} = ThreadWatcher
|
||||||
for threadID, data of db.data.boards[g.BOARD.ID] when threadID not in g.BOARD.threads
|
boardID = g.BOARD.ID
|
||||||
|
for threadID, data of db.data.boards[boardID] when not data.isDead and threadID not of g.BOARD.threads
|
||||||
if Conf['Auto Prune']
|
if Conf['Auto Prune']
|
||||||
ThreadWatcher.rm g.BOARD.ID, threadID
|
ThreadWatcher.db.delete {boardID, threadID}
|
||||||
else
|
else
|
||||||
data.isDead = true
|
data.isDead = true
|
||||||
db.data.lastChecked = Date.now()
|
ThreadWatcher.db.set {boardID, threadID, val: data}
|
||||||
db.save()
|
|
||||||
ThreadWatcher.refresh()
|
ThreadWatcher.refresh()
|
||||||
onThreadRefresh: (e) ->
|
onThreadRefresh: (e) ->
|
||||||
{thread} = e.detail
|
{thread} = e.detail
|
||||||
@ -114,7 +114,7 @@ ThreadWatcher =
|
|||||||
ThreadWatcher.status.textContent = status
|
ThreadWatcher.status.textContent = status
|
||||||
return if @status isnt 404
|
return if @status isnt 404
|
||||||
if Conf['Auto Prune']
|
if Conf['Auto Prune']
|
||||||
ThreadWatcher.rm boardID, threadID
|
ThreadWatcher.db.delete {boardID, threadID}
|
||||||
else
|
else
|
||||||
data.isDead = true
|
data.isDead = true
|
||||||
ThreadWatcher.db.set {boardID, threadID, val: data}
|
ThreadWatcher.db.set {boardID, threadID, val: data}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user