diff --git a/app/controllers/api/v1/timelines/explore_controller.rb b/app/controllers/api/v1/timelines/explore_controller.rb index 1c2ae43a..00b89b7e 100644 --- a/app/controllers/api/v1/timelines/explore_controller.rb +++ b/app/controllers/api/v1/timelines/explore_controller.rb @@ -71,7 +71,7 @@ class Api::V1::Timelines::ExploreController < Api::BaseController reply: false ).paginate_by_id( limit_param(DEFAULT_STATUSES_LIMIT), - params_slice(:max_id, :since_id, :min_id) + params_slice(:max_id, :since_id) ).reject { |status| FeedManager.instance.filter?(:home, status, current_account.id) } elsif @sort_type == 'recent' statuses = Status.with_public_visibility.where( @@ -80,16 +80,15 @@ class Api::V1::Timelines::ExploreController < Api::BaseController 'status_stats.replies_count > 0 OR status_stats.reblogs_count > 0 OR status_stats.favourites_count > 0' ).order('status_stats.updated_at DESC').paginate_by_id( limit_param(DEFAULT_STATUSES_LIMIT), - params_slice(:max_id, :since_id, :min_id) + params_slice(:max_id, :since_id) ).reject { |status| FeedManager.instance.filter?(:home, status, current_account.id) } elsif ['top_today', 'top_weekly', 'top_monthly', 'top_yearly', 'top_all_time', 'hot'].include? @sort_type if @sort_type == 'top_all_time' statuses = Status.unscoped.with_public_visibility.where( reply: false - ).joins(:status_stat).order(top_order) - .paginate_by_id( + ).joins(:status_stat).order(top_order).paginate_by_id( limit_param(DEFAULT_STATUSES_LIMIT), - params_slice(:max_id, :since_id, :min_id) + params_slice(:max_id, :since_id) ).reject { |status| FeedManager.instance.filter?(:home, status, current_account.id) } elsif @sort_type == 'hot' statuses = Status.unscoped.with_public_visibility.where( @@ -98,7 +97,7 @@ class Api::V1::Timelines::ExploreController < Api::BaseController 'statuses.created_at > ?', date_limit ).joins(:status_stat).order(top_order).paginate_by_id( limit_param(DEFAULT_STATUSES_LIMIT), - params_slice(:max_id, :since_id, :min_id) + params_slice(:max_id, :since_id) ).reject { |status| FeedManager.instance.filter?(:home, status, current_account.id) } else statuses = Status.unscoped.with_public_visibility.where( @@ -107,7 +106,7 @@ class Api::V1::Timelines::ExploreController < Api::BaseController 'statuses.created_at > ?', date_limit ).joins(:status_stat).order(top_order).paginate_by_id( limit_param(DEFAULT_STATUSES_LIMIT), - params_slice(:max_id, :since_id, :min_id) + params_slice(:max_id, :since_id) ).reject { |status| FeedManager.instance.filter?(:home, status, current_account.id) } end end @@ -117,7 +116,7 @@ class Api::V1::Timelines::ExploreController < Api::BaseController reply: false ).paginate_by_id( limit_param(DEFAULT_STATUSES_LIMIT), - params_slice(:max_id, :since_id, :min_id) + params_slice(:max_id, :since_id) ) elsif @sort_type == 'recent' statuses = Status.with_public_visibility.where( @@ -126,16 +125,15 @@ class Api::V1::Timelines::ExploreController < Api::BaseController 'status_stats.replies_count > 0 OR status_stats.reblogs_count > 0 OR status_stats.favourites_count > 0' ).order('status_stats.updated_at DESC').paginate_by_id( limit_param(DEFAULT_STATUSES_LIMIT), - params_slice(:max_id, :since_id, :min_id) + params_slice(:max_id, :since_id) ) elsif ['top_today', 'top_weekly', 'top_monthly', 'top_yearly', 'top_all_time', 'hot'].include? @sort_type if @sort_type == 'top_all_time' statuses = Status.unscoped.with_public_visibility.where( reply: false - ).joins(:status_stat).order(top_order) - .paginate_by_id( + ).joins(:status_stat).order(top_order).paginate_by_id( limit_param(DEFAULT_STATUSES_LIMIT), - params_slice(:max_id, :since_id, :min_id) + params_slice(:max_id, :since_id) ) else statuses = Status.unscoped.with_public_visibility.where( @@ -144,7 +142,7 @@ class Api::V1::Timelines::ExploreController < Api::BaseController 'statuses.created_at > ?', date_limit ).joins(:status_stat).order(top_order).paginate_by_id( limit_param(DEFAULT_STATUSES_LIMIT), - params_slice(:max_id, :since_id, :min_id) + params_slice(:max_id, :since_id) ) end end diff --git a/app/javascript/gabsocial/components/timeline_injections/timeline_injection_layout.js b/app/javascript/gabsocial/components/timeline_injections/timeline_injection_layout.js index 9a0e6e48..efe05bd8 100644 --- a/app/javascript/gabsocial/components/timeline_injections/timeline_injection_layout.js +++ b/app/javascript/gabsocial/components/timeline_injections/timeline_injection_layout.js @@ -37,6 +37,7 @@ class TimelineInjectionLayout extends React.PureComponent { subtitle, children, buttonLink, + buttonHref, buttonTitle, isXS, } = this.props @@ -90,6 +91,7 @@ class TimelineInjectionLayout extends React.PureComponent { color='none' backgroundColor='none' to={buttonLink} + href={buttonHref} className={[_s.px15, _s.py15, _s.bgSubtle_onHover].join(' ')} > @@ -106,6 +108,7 @@ class TimelineInjectionLayout extends React.PureComponent { TimelineInjectionLayout.propTypes = { title: PropTypes.string, buttonLink: PropTypes.string, + buttonHref: PropTypes.string, buttonTitle: PropTypes.string, id: PropTypes.string.isRequired, subtitle: PropTypes.string, diff --git a/app/javascript/gabsocial/features/news.js b/app/javascript/gabsocial/features/news.js index b96c07af..48ecc1c8 100644 --- a/app/javascript/gabsocial/features/news.js +++ b/app/javascript/gabsocial/features/news.js @@ -202,9 +202,9 @@ class News extends React.PureComponent { } const mapStateToProps = (state) => ({ - isError: state.getIn(['gab_trends', 'partner', 'isError']), - isLoading: state.getIn(['gab_trends', 'partner', 'isLoading']), - items: state.getIn(['gab_trends', 'partner', 'items']), + isError: state.getIn(['gab', 'partner', 'isError']), + isLoading: state.getIn(['gab', 'partner', 'isLoading']), + items: state.getIn(['gab', 'partner', 'items']), }) const mapDispatchToProps = (dispatch) => ({