From 06b38a19af5048e76e99af959b0cc20cf06a79ce Mon Sep 17 00:00:00 2001 From: evazion Date: Tue, 17 May 2022 03:59:01 -0500 Subject: [PATCH] posts: don't show nsfw tags in sidebar in safe mode. Fix the post index page to not show nsfw tags in the sidebar in safe mode. Instead of showing the most popular tags on the front page, or the most similar tags to the current search, show only frequent tags (the top 25 tags from posts on the current page). --- app/logical/post_sets/post.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/logical/post_sets/post.rb b/app/logical/post_sets/post.rb index 607ebf4be..b8f16a543 100644 --- a/app/logical/post_sets/post.rb +++ b/app/logical/post_sets/post.rb @@ -161,13 +161,13 @@ module PostSets concerning :TagListMethods do def related_tags - if post_query.wildcards.one? && post_query.tags.none? + if normalized_query.wildcards.one? && normalized_query.tags.none? wildcard_tags - elsif post_query.is_metatag?(:search) + elsif normalized_query.is_metatag?(:search) saved_search_tags - elsif post_query.is_empty_search? || post_query.is_metatag?(:order, :rank) + elsif normalized_query.is_empty_search? || normalized_query.is_metatag?(:order, :rank) popular_tags.presence || frequent_tags - elsif post_query.is_single_term? + elsif normalized_query.is_single_term? similar_tags.presence || frequent_tags else frequent_tags