diff --git a/Logic/Tags/Tag.ts b/Logic/Tags/Tag.ts index a40df5453e..3db63a9c38 100644 --- a/Logic/Tags/Tag.ts +++ b/Logic/Tags/Tag.ts @@ -82,9 +82,9 @@ export class Tag extends TagsFilter { if (shorten) { v = Utils.EllipsesAfter(v, 25) } - if (v === "" || (v === undefined && currentProperties !== undefined)) { + if ((v === "" || v === undefined) && currentProperties !== undefined) { // This tag will be removed if in the properties, so we indicate this with special rendering - if (currentProperties !== undefined && (currentProperties[this.key] ?? "") === "") { + if ((currentProperties[this.key] ?? "") === "") { // This tag is not present in the current properties, so this tag doesn't change anything return "" } diff --git a/UI/Popup/DeleteWizard.ts b/UI/Popup/DeleteWizard.ts index 637fb32672..beab1237c7 100644 --- a/UI/Popup/DeleteWizard.ts +++ b/UI/Popup/DeleteWizard.ts @@ -228,6 +228,7 @@ export default class DeleteWizard extends Toggle { new SvelteUIElement(TagHint, { osmConnection: state.osmConnection, tags: retag, + currentProperties: currentTags.data }), ]) } diff --git a/UI/Popup/TagHint.svelte b/UI/Popup/TagHint.svelte index d4ba075bff..14f2424d59 100644 --- a/UI/Popup/TagHint.svelte +++ b/UI/Popup/TagHint.svelte @@ -11,13 +11,15 @@ */ export let tags: TagsFilter; export let state: SpecialVisualizationState; + + export let currentProperties: Record = {} /** * If given, this function will be called to embed the given tags hint into this translation */ export let embedIn: ((string: string) => Translation) | undefined = undefined; const userDetails = state.osmConnection.userDetails; let tagsExplanation = ""; - $: tagsExplanation = tags?.asHumanString(true, false, {}); + $: tagsExplanation = tags?.asHumanString(true, false, currentProperties); {#if $userDetails.loggedIn} diff --git a/UI/Popup/TagRendering/TagRenderingQuestion.svelte b/UI/Popup/TagRendering/TagRenderingQuestion.svelte index 18f8d0261b..0bf235798d 100644 --- a/UI/Popup/TagRendering/TagRenderingQuestion.svelte +++ b/UI/Popup/TagRendering/TagRenderingQuestion.svelte @@ -212,7 +212,7 @@ {#if $showTags === "yes" || $showTags === "always" || ($showTags === "" && numberOfCs >= Constants.userJourney.tagsVisibleAt) || $featureSwitchIsTesting || $featureSwitchIsDebugging} - + {#if $featureSwitchIsTesting} Testmode