Use stringify version for options in searchOptions component

This commit is contained in:
Franco Montenegro 2021-02-18 15:41:46 -03:00 committed by Sean Yesmunt
parent ddae2e8ac5
commit 8d21acf64c

View file

@ -14,12 +14,14 @@ type Props = {
const SearchOptions = (props: Props) => {
const { options, setSearchOption, expanded, toggleSearchExpanded } = props;
const stringifiedOptions = JSON.stringify(options);
const resultCount = options[SEARCH_OPTIONS.RESULT_COUNT];
const isFilteringByChannel = useMemo(() => {
const claimType = String(options[SEARCH_OPTIONS.CLAIM_TYPE] || '');
const jsonOptions = JSON.parse(stringifiedOptions);
const claimType = String(jsonOptions[SEARCH_OPTIONS.CLAIM_TYPE] || '');
return claimType.includes(SEARCH_OPTIONS.INCLUDE_CHANNELS);
}, [options]);
}, [stringifiedOptions]);
return (
<div>