From 9891f03bcaaab1be14401ab948c87b19c2081ce2 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Wed, 21 Sep 2016 05:25:06 -0700 Subject: [PATCH] Fix catalog crashing on hidden/filtered threads. --- src/General/Index.coffee | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/General/Index.coffee b/src/General/Index.coffee index 71184a8c1..7a6214d4a 100644 --- a/src/General/Index.coffee +++ b/src/General/Index.coffee @@ -630,8 +630,7 @@ Index = Main.handleErrors errors if errors Main.callbackNodes 'Post', posts - buildCatalogViews: -> - threads = Index.sortedThreads.filter (thread) -> !thread.isHidden isnt Index.showHiddenThreads + buildCatalogViews: (threads) -> catalogThreads = [] for thread in threads when !thread.catalogView catalogThreads.push new CatalogThread Build.catalogThread(thread), thread @@ -692,15 +691,17 @@ Index = buildIndex: -> return unless Index.liveThreadData switch Conf['Index Mode'] - when 'all pages', 'catalog' + when 'all pages' threads = Index.sortedThreads + when 'catalog' + threads = Index.sortedThreads.filter (thread) -> !thread.isHidden isnt Index.showHiddenThreads else threads = Index.threadsOnPage Index.currentPage delete Index.pageNum $.rmAll Index.root $.rmAll Header.hover if Conf['Index Mode'] is 'catalog' - nodes = Index.buildCatalogViews() + nodes = Index.buildCatalogViews threads Index.sizeCatalogViews nodes Index.moveComments threads if Conf['Index Mode'] is 'catalog'