diff --git a/packages/desktop-client/src/components/reports/CategorySelector.tsx b/packages/desktop-client/src/components/reports/CategorySelector.tsx index 8dc2da84dab..d8ecbba27d9 100644 --- a/packages/desktop-client/src/components/reports/CategorySelector.tsx +++ b/packages/desktop-client/src/components/reports/CategorySelector.tsx @@ -53,117 +53,124 @@ export default function CategorySelector({ }} > {categoryGroups && - categoryGroups.map(categoryGroup => { - const allCategoriesInGroupSelected = categoryGroup.categories.every( - category => - selectedCategories.some( - selectedCategory => selectedCategory.id === category.id, - ), - ); - const noCategorySelected = categoryGroup.categories.every( - category => - !selectedCategories.some( - selectedCategory => selectedCategory.id === category.id, - ), - ); - return ( - -
  • - { - const selectedCategoriesExcludingGroupCategories = - selectedCategories.filter( - selectedCategory => - !categoryGroup.categories.some( - groupCategory => - groupCategory.id === selectedCategory.id, - ), - ); - if (allCategoriesInGroupSelected) { - setSelectedCategories( - selectedCategoriesExcludingGroupCategories, - ); - } else { - setSelectedCategories( - selectedCategoriesExcludingGroupCategories.concat( - categoryGroup.categories, - ), - ); - } - }} - /> - -
  • -
  • - +
  • +
    + ); + })} ); diff --git a/upcoming-release-notes/1696.md b/upcoming-release-notes/1696.md new file mode 100644 index 00000000000..517290c0854 --- /dev/null +++ b/upcoming-release-notes/1696.md @@ -0,0 +1,6 @@ +--- +category: Enhancements +authors: [kyrias] +--- + +Hide hidden groups and categories from spending report category selector.