From ddae2e8ac56b559e32c33a6e6b239442dfb8e061 Mon Sep 17 00:00:00 2001 From: Franco Montenegro Date: Tue, 16 Feb 2021 13:59:16 -0300 Subject: [PATCH] Disable claim type search if filtering by channel --- ui/component/searchOptions/view.jsx | 13 +++++++++---- ui/util/query-params.js | 9 ++++++--- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/ui/component/searchOptions/view.jsx b/ui/component/searchOptions/view.jsx index 0b0090beb..67d12a7c8 100644 --- a/ui/component/searchOptions/view.jsx +++ b/ui/component/searchOptions/view.jsx @@ -1,7 +1,7 @@ // @flow import { SEARCH_OPTIONS } from 'constants/search'; import * as ICONS from 'constants/icons'; -import React from 'react'; +import React, { useMemo } from 'react'; import { Form, FormField } from 'component/common/form'; import Button from 'component/button'; @@ -16,6 +16,11 @@ const SearchOptions = (props: Props) => { const { options, setSearchOption, expanded, toggleSearchExpanded } = props; const resultCount = options[SEARCH_OPTIONS.RESULT_COUNT]; + const isFilteringByChannel = useMemo(() => { + const claimType = String(options[SEARCH_OPTIONS.CLAIM_TYPE] || ''); + return claimType.includes(SEARCH_OPTIONS.INCLUDE_CHANNELS); + }, [options]); + return (