Fix bug from 473cbf122853db399fefa0efd21fdbb8f21637eb causing Thread Watcher refresh button to spin indefinitely after switching tabs.

This commit is contained in:
ccd0 2019-07-15 12:37:10 -07:00
parent b221ed8da2
commit 35bbf9e129

View File

@ -250,9 +250,9 @@ ThreadWatcher =
for dbi in dbs for dbi in dbs
dbi.forceSync -> dbi.forceSync ->
if (++n) is dbs.length if (++n) is dbs.length
return if 0 <= Date.now() - (ThreadWatcher.db.data.lastChecked or 0) < interval # checked in another tab
return if !ThreadWatcher.syncing # aborted return if !ThreadWatcher.syncing # aborted
delete ThreadWatcher.syncing delete ThreadWatcher.syncing
unless 0 <= Date.now() - (ThreadWatcher.db.data.lastChecked or 0) < interval # not checked in another tab
# XXX On vichan boards, last_modified field of threads.json does not account for sage posts. # XXX On vichan boards, last_modified field of threads.json does not account for sage posts.
# Occasionally check replies field of catalog.json to find these posts. # Occasionally check replies field of catalog.json to find these posts.
{db} = ThreadWatcher {db} = ThreadWatcher