From 944b0fdb01f3dc898958c2ee28ad344bec859efe Mon Sep 17 00:00:00 2001 From: LieutenantRoger Date: Mon, 5 Oct 2020 21:41:25 +0800 Subject: [PATCH] fix side impact --- .../challenge-listing/Filters/FiltersPanel/index.jsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/shared/components/challenge-listing/Filters/FiltersPanel/index.jsx b/src/shared/components/challenge-listing/Filters/FiltersPanel/index.jsx index 8c36d666fd..40605d8eee 100644 --- a/src/shared/components/challenge-listing/Filters/FiltersPanel/index.jsx +++ b/src/shared/components/challenge-listing/Filters/FiltersPanel/index.jsx @@ -181,11 +181,11 @@ export default function FiltersPanel({ }; const communityOps = communityFilters.filter(community => ( - !community.hidden && community.groupIds && community.groupIds.length > 0 + (!community.hidden && community.groupIds && community.groupIds.length > 0) || community.communityName === 'All' )) .map(community => ({ label: community.communityName, - value: community.groupIds[0], + value: community.communityName === 'All' ? '' : community.groupIds[0], name: community.communityName, data: getLabel(community), })); @@ -244,9 +244,9 @@ export default function FiltersPanel({ id="community-select" // onChange={selectCommunity} onChange={(value) => { - // const group = value; - // setFilterState({ ..._.clone(filterState), groups: group === '' ? [] : [group] }); - setFilterState({ ..._.clone(filterState), groups: [value] }); + const group = value; + setFilterState({ ..._.clone(filterState), groups: group === '' ? [] : [group] }); + // setFilterState({ ..._.clone(filterState), groups: [value] }); }} options={communityOps} simpleValue