Skip to content

Commit

Permalink
Fix filtering of exact tag searches (#912)
Browse files Browse the repository at this point in the history
  • Loading branch information
InfiniteStash authored Jan 24, 2025
1 parent 2fb6b66 commit 38b6b13
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 14 deletions.
17 changes: 10 additions & 7 deletions frontend/src/components/tagFilter/TagFilter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,16 @@ const TagFilter: FC<TagFilterProps> = ({

const { exact, query } = data;

const exactResult = exact
? {
label: exact.name,
value: exact,
sublabel: exact.description ?? "",
}
: undefined;
const exactResult =
exact &&
(allowDeleted || !exact.deleted) &&
!excludeTags.includes(exact.id)
? {
label: exact.name,
value: exact,
sublabel: exact.description ?? "",
}
: undefined;

const queryResult = query
.filter(
Expand Down
15 changes: 8 additions & 7 deletions frontend/src/components/tagSelect/TagSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,14 @@ const TagSelect: FC<TagSelectProps> = ({

const { exact, query } = data;

const exactResult = exact
? {
label: exact.name,
value: exact,
sublabel: exact.description ?? "",
}
: undefined;
const exactResult =
exact && !excluded.includes(exact.id) && (allowDeleted || !exact.deleted)
? {
label: exact.name,
value: exact,
sublabel: exact.description ?? "",
}
: undefined;

const queryResult = query
.filter(
Expand Down

0 comments on commit 38b6b13

Please # to comment.