Tags: Fix exclusion on load

The new filter system wasn't applying when tags are loaded. Fix this
by adding an extra step in the for loop.

Signed-off-by: kingbri <bdashore3@proton.me>
This commit is contained in:
kingbri 2023-08-25 00:29:10 -04:00
parent aceb32cfe9
commit 990bf63d59
1 changed files with 7 additions and 0 deletions

View File

@ -338,6 +338,10 @@ function onTagFilterClick(listElement) {
}
}
runTagFilters(listElement);
}
function runTagFilters(listElement) {
const tagIds = [...($(listElement).find(".tag.selected:not(.actionable)").map((_, el) => $(el).attr("id")))];
const excludedTagIds = [...($(listElement).find(".tag.excluded:not(.actionable)").map((_, el) => $(el).attr("id")))];
const filterHelper = getFilterHelper($(listElement));
@ -364,6 +368,9 @@ function printTagFilters(type = tag_filter_types.character) {
}
for (const tag of tagsToDisplay) {
appendTagToList(FILTER_SELECTOR, tag, { removable: false, selectable: true, isGeneralList: true });
if (tag.excluded) {
runTagFilters(FILTER_SELECTOR);
}
}
for (const tagId of selectedTagIds) {