Skip to content

Commit

Permalink
filter enabled tag
Browse files Browse the repository at this point in the history
  • Loading branch information
dukenv0307 committed Feb 21, 2024
1 parent 1cab9fd commit cb3206f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/libs/OptionsListUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1061,7 +1061,8 @@ function getTagsOptions(tags: Category[]): Option[] {
function getTagListSections(tags: Tag[], recentlyUsedTags: string[], selectedOptions: Category[], searchInputValue: string, maxRecentReportsToShow: number) {
const tagSections = [];
const sortedTags = sortTags(tags);
const enabledTags = [...selectedOptions, ...sortedTags.filter((tag) => tag.enabled)];
const selectedOptionNames = selectedOptions.map((selectedOption) => selectedOption.name);
const enabledTags = [...selectedOptions, ...sortedTags.filter((tag) => tag.enabled && !selectedOptionNames.includes(tag.name))];
const numberOfTags = enabledTags.length;
let indexOffset = 0;

Expand Down Expand Up @@ -1109,7 +1110,6 @@ function getTagListSections(tags: Tag[], recentlyUsedTags: string[], selectedOpt
return tagSections;
}

const selectedOptionNames = selectedOptions.map((selectedOption) => selectedOption.name);
const filteredRecentlyUsedTags = recentlyUsedTags
.filter((recentlyUsedTag) => {
const tagObject = tags.find((tag) => tag.name === recentlyUsedTag);
Expand Down

0 comments on commit cb3206f

Please sign in to comment.