From 990bf63d59bf03c89d2728c2ec0d88a2532e3be8 Mon Sep 17 00:00:00 2001 From: kingbri Date: Fri, 25 Aug 2023 00:29:10 -0400 Subject: [PATCH] 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 --- public/scripts/tags.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/public/scripts/tags.js b/public/scripts/tags.js index f486fbb08..0d913b2d8 100644 --- a/public/scripts/tags.js +++ b/public/scripts/tags.js @@ -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) {