Skip to content

Commit

Permalink
fix: cannot unselect disabled category
Browse files Browse the repository at this point in the history
  • Loading branch information
tienifr committed Feb 6, 2024
1 parent 13f832c commit 71c38ff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libs/OptionsListUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -973,7 +973,7 @@ function getCategoryListSections(
}

const selectedOptionNames = selectedOptions.map((selectedOption) => selectedOption.name);
const enabledAndSelectedCategories = sortedCategories.filter((category) => category.enabled || selectedOptionNames.includes(category.name));
const enabledAndSelectedCategories = [...selectedOptions, ...sortedCategories.filter((category) => category.enabled && !selectedOptionNames.includes(category.name))];
const numberOfVisibleCategories = enabledAndSelectedCategories.length;

if (numberOfVisibleCategories < CONST.CATEGORY_LIST_THRESHOLD) {
Expand Down

0 comments on commit 71c38ff

Please sign in to comment.