Fix Thread Watcher bug that in certain circumstances caused the last check of an archived thread for new replies to be skipped.
This commit is contained in:
parent
cc02b152ff
commit
f61fc5f1ee
@ -154,13 +154,14 @@ ThreadWatcher =
|
|||||||
for threadID, data of db.data[siteID].boards[boardID] when not data?.isDead and "#{boardID}.#{threadID}" not in e.detail.threads
|
for threadID, data of db.data[siteID].boards[boardID] when not data?.isDead and "#{boardID}.#{threadID}" not in e.detail.threads
|
||||||
# Don't prune threads that have yet to appear in index.
|
# Don't prune threads that have yet to appear in index.
|
||||||
continue unless e.detail.threads.some (fullID) -> +fullID.split('.')[1] > threadID
|
continue unless e.detail.threads.some (fullID) -> +fullID.split('.')[1] > threadID
|
||||||
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}
|
||||||
|
nKilled++
|
||||||
|
else if ThreadWatcher.unreadEnabled and Conf['Show Unread Count']
|
||||||
|
ThreadWatcher.fetchStatus {siteID, boardID, threadID, data}
|
||||||
else
|
else
|
||||||
db.extend {boardID, threadID, val: {isDead: true}}
|
db.extend {boardID, threadID, val: {isDead: true}}
|
||||||
if ThreadWatcher.unreadEnabled and Conf['Show Unread Count']
|
nKilled++
|
||||||
ThreadWatcher.fetchStatus {siteID, boardID, threadID, data}
|
|
||||||
ThreadWatcher.refresh() if nKilled
|
ThreadWatcher.refresh() if nKilled
|
||||||
onThreadRefresh: (e) ->
|
onThreadRefresh: (e) ->
|
||||||
thread = g.threads[e.detail.threadID]
|
thread = g.threads[e.detail.threadID]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user