Fix #5073: Navigating search containing pool tag only uses pool

Show the search navbar when searching for `pool:1234 tag`. Before the
search navbar would always be hidden if the search contained a pool:
metatag, even if it was a multi-tag search.
This commit is contained in:
evazion
2022-08-28 23:03:05 -05:00
parent 4448b3d15b
commit e1df93c4dc
2 changed files with 20 additions and 2 deletions

View File

@@ -37,17 +37,19 @@ class PostNavbarComponent < ApplicationComponent
end
def selected_pool
return nil unless query.is_metatag?(:pool) || query.is_metatag?(:ordpool)
value = query.find_metatag(:pool, :ordpool)
Pool.find_by_name(value) if value.present?
end
def selected_favgroup
return nil unless query.is_metatag?(:favgroup) || query.is_metatag?(:ordfavgroup)
value = query.find_metatag(:favgroup, :ordfavgroup)
FavoriteGroup.find_by_name_or_id(value, current_user) if value.present?
end
def query
@query ||= PostQuery.new(search)
@query ||= PostQuery.new(search).trim
end
memoize :favgroups, :selected_pool, :selected_favgroup