Don't use the IndexBuild event for hiding threads.
This commit is contained in:
parent
7623040593
commit
509156a956
@ -4,7 +4,7 @@ ThreadHiding =
|
|||||||
|
|
||||||
@db = new DataBoard 'hiddenThreads'
|
@db = new DataBoard 'hiddenThreads'
|
||||||
@syncCatalog()
|
@syncCatalog()
|
||||||
$.on d, 'IndexBuild', @onIndexBuild
|
$.on d, 'IndexRefresh', @onIndexRefresh
|
||||||
Thread.callbacks.push
|
Thread.callbacks.push
|
||||||
name: 'Thread Hiding'
|
name: 'Thread Hiding'
|
||||||
cb: @node
|
cb: @node
|
||||||
@ -15,8 +15,8 @@ ThreadHiding =
|
|||||||
return unless Conf['Thread Hiding']
|
return unless Conf['Thread Hiding']
|
||||||
$.prepend @OP.nodes.root, ThreadHiding.makeButton @, 'hide'
|
$.prepend @OP.nodes.root, ThreadHiding.makeButton @, 'hide'
|
||||||
|
|
||||||
onIndexBuild: ({detail: nodes}) ->
|
onIndexRefresh: ->
|
||||||
for root, i in nodes by 2
|
for root, i in Index.nodes by 2
|
||||||
thread = Get.threadFromRoot root
|
thread = Get.threadFromRoot root
|
||||||
continue unless thread.isHidden
|
continue unless thread.isHidden
|
||||||
unless thread.stub
|
unless thread.stub
|
||||||
|
|||||||
@ -390,8 +390,8 @@ Index =
|
|||||||
nodes = Index.sortedNodes
|
nodes = Index.sortedNodes
|
||||||
$.rmAll Index.root
|
$.rmAll Index.root
|
||||||
Index.buildReplies nodes if Conf['Show Replies'] and Conf['Index Mode'] isnt 'catalog'
|
Index.buildReplies nodes if Conf['Show Replies'] and Conf['Index Mode'] isnt 'catalog'
|
||||||
$.event 'IndexBuild', nodes
|
|
||||||
$.add Index.root, nodes
|
$.add Index.root, nodes
|
||||||
|
$.event 'IndexBuild', nodes
|
||||||
|
|
||||||
isSearching: false
|
isSearching: false
|
||||||
clearSearch: ->
|
clearSearch: ->
|
||||||
|
|||||||
@ -72,9 +72,8 @@ 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
|
|
||||||
boardID = g.BOARD.ID
|
boardID = g.BOARD.ID
|
||||||
for threadID, data of db.data.boards[boardID] when not data.isDead and threadID not of g.BOARD.threads
|
for threadID, data of ThreadWatcher.db.data.boards[boardID] when not data.isDead and threadID not of g.BOARD.threads
|
||||||
if Conf['Auto Prune']
|
if Conf['Auto Prune']
|
||||||
ThreadWatcher.db.delete {boardID, threadID}
|
ThreadWatcher.db.delete {boardID, threadID}
|
||||||
else
|
else
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user