From 0176c350a0c3e256dc573e6759b44b38b5011f1e Mon Sep 17 00:00:00 2001 From: ccd0 Date: Mon, 22 Jul 2019 00:25:28 -0700 Subject: [PATCH] Remember number of replies to contract thread to instead of hardcoding it for each board. #525 --- src/Miscellaneous/ExpandThread.coffee | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/Miscellaneous/ExpandThread.coffee b/src/Miscellaneous/ExpandThread.coffee index 3ac687784..12a07e175 100644 --- a/src/Miscellaneous/ExpandThread.coffee +++ b/src/Miscellaneous/ExpandThread.coffee @@ -58,6 +58,7 @@ ExpandThread = return if @ isnt status.req # aborted delete status.req ExpandThread.parse @, thread, a + status.numReplies = $$(g.SITE.selectors.postContainer + g.SITE.selectors.relative.replyPost, thread.nodes.root).length contract: (thread, a, threadRoot) -> status = ExpandThread.statuses[thread] @@ -69,15 +70,7 @@ ExpandThread = return replies = $$ '.thread > .replyContainer', threadRoot - if !Conf['JSON Index'] or Conf['Show Replies'] - num = if thread.isSticky - 1 - else switch g.BOARD.ID - # XXX boards config - when 'b', 'vg', 'bant' then 3 - when 't' then 1 - else 5 - replies = replies[...-num] + replies = replies[...(-status.numReplies)] if status.numReplies postsCount = 0 filesCount = 0 for reply in replies