From 7f41a7e6f03a0fa132ceedacfad4de60ee874c03 Mon Sep 17 00:00:00 2001 From: KoloMl Date: Thu, 12 Mar 2026 01:07:37 +0400 Subject: [PATCH] Fixed tag removal stopping on the first encountered missing tag Syntax of `-tagname` we rely upon here will stop execution of suggested tags when first tag which is not present in the editor is encountered. Just a Philomena's specific quirk, nothing more. --- src/content/components/philomena/TagsForm.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/content/components/philomena/TagsForm.ts b/src/content/components/philomena/TagsForm.ts index 923850b..63e5ac8 100644 --- a/src/content/components/philomena/TagsForm.ts +++ b/src/content/components/philomena/TagsForm.ts @@ -180,7 +180,11 @@ export class TagsForm extends BaseComponent { } if (removedTags) { - tagChangeList.push(...Array.from(removedTags).map(tagName => `-${tagName}`)); + tagChangeList.push( + ...Array.from(removedTags) + .filter(tagName => this.#tagsSet.has(tagName)) + .map(tagName => `-${tagName}`) + ); } this.#applyTagChangesWithFancyTagEditor(