From 1e5d12497c9d446d57c5cadf69c6897cdf8b4ac6 Mon Sep 17 00:00:00 2001 From: Fosco Marotto Date: Fri, 22 Jan 2021 00:46:51 -0500 Subject: [PATCH] [group collection] default to hot posts --- .../api/v1/timelines/group_collection_controller.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/api/v1/timelines/group_collection_controller.rb b/app/controllers/api/v1/timelines/group_collection_controller.rb index 22b61003..95fba281 100644 --- a/app/controllers/api/v1/timelines/group_collection_controller.rb +++ b/app/controllers/api/v1/timelines/group_collection_controller.rb @@ -32,7 +32,7 @@ class Api::V1::Timelines::GroupCollectionController < Api::BaseController private def set_sort_type - @sort_type = 'newest' + @sort_type = 'hot' @sort_type = params[:sort_by] if [ 'hot', 'newest', @@ -43,7 +43,7 @@ class Api::V1::Timelines::GroupCollectionController < Api::BaseController 'top_yearly', 'top_all_time', ].include? params[:sort_by] - + if @collection_type === 'featured' && (@sort_type == 'newest' || @sort_type == 'recent') @sort_type = 'hot' end @@ -66,7 +66,7 @@ class Api::V1::Timelines::GroupCollectionController < Api::BaseController elsif @collection_type == 'member' && !current_account.nil? @groupIds = current_account.groups.pluck(:id) end - + if current_account SortingQueryBuilder.new.call(@sort_type, @groupIds, params[:page]).reject {|status| FeedManager.instance.filter?(:home, status, current_account.id)