From 41dfa008d02a6b7a4c962dac147cf9cc3d435ff1 Mon Sep 17 00:00:00 2001 From: pietervdvn Date: Thu, 23 Dec 2021 00:31:49 +0100 Subject: [PATCH] Don't show a removed tag if it was present on the object in the first place --- Logic/Tags/Tag.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Logic/Tags/Tag.ts b/Logic/Tags/Tag.ts index a6f4fa91c1..2d3c8a4a32 100644 --- a/Logic/Tags/Tag.ts +++ b/Logic/Tags/Tag.ts @@ -41,12 +41,17 @@ export class Tag extends TagsFilter { return [`["${this.key}"="${this.value}"]`]; } - asHumanString(linkToWiki?: boolean, shorten?: boolean) { + asHumanString(linkToWiki?: boolean, shorten?: boolean, currentProperties?: any) { let v = this.value; if (shorten) { v = Utils.EllipsesAfter(v, 25); } if(v === "" || v === undefined){ + // This tag will be removed if in the properties, so we indicate this with special rendering + if(currentProperties !== undefined && (currentProperties[this.key] ?? "") !== ""){ + // This tag is not present in the current properties, so this tag doesn't change anything + return "" + } return ""+this.key+"" } if (linkToWiki) {