Don't show a removed tag if it was present on the object in the first place

This commit is contained in:
Pieter Vander Vennet 2021-12-23 00:31:49 +01:00
parent 9e40e459e5
commit 41dfa008d0

View file

@ -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 "<span class='line-through'>"+this.key+"</span>"
}
if (linkToWiki) {