Skip to content

Commit d66ee90

Browse files
committed
display group by filter only if grouping by from/card
1 parent 1353eb6 commit d66ee90

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/components/Search/SearchPageHeader/SearchFiltersBar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ function SearchFiltersBar({queryJSON, headerButtonsOptions, isMobileSelectionMod
417417
const filters = useMemo(() => {
418418
const fromValue = filterFormValues.from?.map((accountID) => personalDetails?.[accountID]?.displayName ?? accountID) ?? [];
419419

420-
const shouldDisplayGroupByFilter = !!groupBy;
420+
const shouldDisplayGroupByFilter = groupBy?.value === CONST.SEARCH.GROUP_BY.FROM || groupBy?.value === CONST.SEARCH.GROUP_BY.CARD;
421421
const shouldDisplayGroupCurrencyFilter = (groupBy?.value === CONST.SEARCH.GROUP_BY.FROM || groupBy?.value === CONST.SEARCH.GROUP_BY.CARD) && hasMultipleOutputCurrency;
422422
const shouldDisplayFeedFilter = feedOptions.length > 1 && !!filterFormValues.feed;
423423
const shouldDisplayPostedFilter = !!filterFormValues.feed && (!!filterFormValues.postedOn || !!filterFormValues.postedAfter || !!filterFormValues.postedBefore);

src/pages/Search/AdvancedSearchFilters.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,7 @@ function AdvancedSearchFilters() {
632632
const shouldDisplayCardFilter = shouldDisplayFilter(Object.keys(allCards).length, areCardsEnabled);
633633
const shouldDisplayTaxFilter = shouldDisplayFilter(Object.keys(taxRates).length, areTaxEnabled);
634634
const shouldDisplayWorkspaceFilter = workspaces.some((section) => section.data.length !== 0);
635-
const shouldDisplayGroupByFilter = !!groupBy;
635+
const shouldDisplayGroupByFilter = groupBy === CONST.SEARCH.GROUP_BY.FROM || groupBy === CONST.SEARCH.GROUP_BY.CARD;
636636
const shouldDisplayGroupCurrencyFilter = groupBy === CONST.SEARCH.GROUP_BY.FROM || groupBy === CONST.SEARCH.GROUP_BY.CARD;
637637

638638
let currentType = searchAdvancedFilters?.type ?? CONST.SEARCH.DATA_TYPES.EXPENSE;

0 commit comments

Comments
 (0)