From 2557cb2f9550f7ab0cd6e6f392642b5249589ed8 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Tue, 5 Feb 2019 00:27:18 +0100 Subject: [PATCH] Fix pinned statuses being shown in a featured hashtag (#9971) --- app/controllers/accounts_controller.rb | 2 +- app/controllers/settings/featured_tags_controller.rb | 2 +- app/views/accounts/show.html.haml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/accounts_controller.rb b/app/controllers/accounts_controller.rb index 6e3a23073b2..cbf1a8287b9 100644 --- a/app/controllers/accounts_controller.rb +++ b/app/controllers/accounts_controller.rb @@ -52,7 +52,7 @@ class AccountsController < ApplicationController private def show_pinned_statuses? - [replies_requested?, media_requested?, params[:max_id].present?, params[:min_id].present?].none? + [replies_requested?, media_requested?, tag_requested?, params[:max_id].present?, params[:min_id].present?].none? end def filtered_statuses diff --git a/app/controllers/settings/featured_tags_controller.rb b/app/controllers/settings/featured_tags_controller.rb index 19815e4168d..3a3241425d6 100644 --- a/app/controllers/settings/featured_tags_controller.rb +++ b/app/controllers/settings/featured_tags_controller.rb @@ -38,7 +38,7 @@ class Settings::FeaturedTagsController < Settings::BaseController end def set_featured_tags - @featured_tags = current_account.featured_tags.reject(&:new_record?) + @featured_tags = current_account.featured_tags.order(statuses_count: :desc).reject(&:new_record?) end def set_most_used_tags diff --git a/app/views/accounts/show.html.haml b/app/views/accounts/show.html.haml index 23a595205c5..0da69728f32 100644 --- a/app/views/accounts/show.html.haml +++ b/app/views/accounts/show.html.haml @@ -63,7 +63,7 @@ - @endorsed_accounts.each do |account| = account_link_to account - - @account.featured_tags.each do |featured_tag| + - @account.featured_tags.order(statuses_count: :desc).each do |featured_tag| .directory__tag{ class: params[:tag] == featured_tag.name ? 'active' : nil } = link_to short_account_tag_path(@account, featured_tag.tag) do %h4