mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Force summary mode when user enters at the top of megalodoon topics.
This commit is contained in:
@@ -405,6 +405,11 @@ class TopicView
|
||||
end
|
||||
end
|
||||
|
||||
def force_summary_mode?
|
||||
@force_summary_mode ||=
|
||||
(@topic.closed? && @topic.posts_count >= (MEGA_TOPIC_POSTS_COUNT * 2))
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def read_posts_set
|
||||
@@ -482,7 +487,7 @@ class TopicView
|
||||
@filtered_posts = unfiltered_posts
|
||||
|
||||
# Filters
|
||||
if @filter == 'summary' || force_summary_mode?
|
||||
if @filter == 'summary' || ((@post_number.blank? || @post_number.to_i == 1) && force_summary_mode?)
|
||||
@filtered_posts = @filtered_posts.summary(@topic.id)
|
||||
@contains_gaps = true unless force_summary_mode?
|
||||
end
|
||||
@@ -572,9 +577,4 @@ class TopicView
|
||||
def is_mega_topic?
|
||||
@topic.posts_count >= MEGA_TOPIC_POSTS_COUNT
|
||||
end
|
||||
|
||||
def force_summary_mode?
|
||||
@force_summary_mode ||=
|
||||
(@topic.closed? && @topic.posts_count >= (MEGA_TOPIC_POSTS_COUNT * 2))
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user