From a761f8c65ec3623430bfcecdb45885a4c6ff61be Mon Sep 17 00:00:00 2001 From: James Grugett Date: Wed, 3 Aug 2022 14:17:45 -0700 Subject: [PATCH] Hide pills while searching --- web/components/contract-search.tsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/web/components/contract-search.tsx b/web/components/contract-search.tsx index 6438a3aa..c1e63175 100644 --- a/web/components/contract-search.tsx +++ b/web/components/contract-search.tsx @@ -107,7 +107,7 @@ export function ContractSearch(props: { const [filter, setFilter] = useState( querySortOptions?.defaultFilter ?? 'open' ) - const pillsEnabled = !additionalFilter + const pillsEnabled = !additionalFilter && !query const [pillFilter, setPillFilter] = useState(undefined) @@ -126,7 +126,7 @@ export function ContractSearch(props: { ? `groupLinks.slug:${additionalFilter.groupSlug}` : '', ] - let facetFilters = query + const facetFilters = query ? additionalFilters : [ ...additionalFilters, @@ -154,8 +154,6 @@ export function ContractSearch(props: { `uniqueBettorIds:${user.id}` : '', ].filter((f) => f) - // Hack to make Algolia work. - facetFilters = ['', ...facetFilters] const numericFilters = query ? []