Fix bug from v1.13.0.3 causing threads to be incorrectly pruned / marked dead in Thread Watcher.
Fixes bug from 293fca67dda7091916cf7483ff6d021cb25cf73c.
This commit is contained in:
parent
62b9e9f8dc
commit
3a98275bb0
@ -614,6 +614,8 @@ Index =
|
|||||||
Build.spoilerRange[g.BOARD.ID] = Index.liveThreadData[0].custom_spoiler
|
Build.spoilerRange[g.BOARD.ID] = Index.liveThreadData[0].custom_spoiler
|
||||||
g.BOARD.threads.forEach (thread) ->
|
g.BOARD.threads.forEach (thread) ->
|
||||||
(thread.collect() unless thread.ID in Index.liveThreadIDs)
|
(thread.collect() unless thread.ID in Index.liveThreadIDs)
|
||||||
|
$.event 'IndexUpdate',
|
||||||
|
threads: ("#{g.BOARD}.#{ID}" for ID in Index.liveThreadIDs)
|
||||||
return
|
return
|
||||||
|
|
||||||
isHidden: (threadID) ->
|
isHidden: (threadID) ->
|
||||||
|
|||||||
@ -28,7 +28,7 @@ ThreadWatcher =
|
|||||||
|
|
||||||
switch g.VIEW
|
switch g.VIEW
|
||||||
when 'index'
|
when 'index'
|
||||||
$.on d, 'IndexRefreshInternal', @cb.onIndexRefresh
|
$.on d, 'IndexUpdate', @cb.onIndexUpdate
|
||||||
when 'thread'
|
when 'thread'
|
||||||
$.on d, 'ThreadUpdate', @cb.onThreadRefresh
|
$.on d, 'ThreadUpdate', @cb.onThreadRefresh
|
||||||
|
|
||||||
@ -139,11 +139,11 @@ ThreadWatcher =
|
|||||||
ThreadWatcher.addRaw boardID, threadID, {}
|
ThreadWatcher.addRaw boardID, threadID, {}
|
||||||
else if Conf['Auto Watch Reply']
|
else if Conf['Auto Watch Reply']
|
||||||
ThreadWatcher.add g.threads[boardID + '.' + threadID]
|
ThreadWatcher.add g.threads[boardID + '.' + threadID]
|
||||||
onIndexRefresh: ->
|
onIndexUpdate: (e) ->
|
||||||
{db} = ThreadWatcher
|
{db} = ThreadWatcher
|
||||||
boardID = g.BOARD.ID
|
boardID = g.BOARD.ID
|
||||||
nKilled = 0
|
nKilled = 0
|
||||||
for threadID, data of db.data.boards[boardID] when not data?.isDead and threadID not of g.BOARD.threads
|
for threadID, data of db.data.boards[boardID] when not data?.isDead and "#{boardID}.#{threadID}" not in e.detail.threads
|
||||||
nKilled++
|
nKilled++
|
||||||
if Conf['Auto Prune'] or not (data and typeof data is 'object') # corrupt data
|
if Conf['Auto Prune'] or not (data and typeof data is 'object') # corrupt data
|
||||||
db.delete {boardID, threadID}
|
db.delete {boardID, threadID}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user