From 55e12c32e5ba21e7f948025fb851c286e8f87148 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Fri, 5 May 2023 16:12:28 +0200 Subject: [PATCH] Don't show irrelevant title icons --- Logic/State/UserRelatedState.ts | 1 + UI/BigComponents/SelectedElementView.svelte | 3 +-- assets/layers/icons/icons.json | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Logic/State/UserRelatedState.ts b/Logic/State/UserRelatedState.ts index 4f0c4e391d..8c9865cff5 100644 --- a/Logic/State/UserRelatedState.ts +++ b/Logic/State/UserRelatedState.ts @@ -251,6 +251,7 @@ export default class UserRelatedState { _theme: layout?.id, _backend: this.osmConnection.Backend(), _applicationOpened: new Date().toISOString(), + _supports_sharing: window.navigator.share ? "yes" : "no" }) const osmConnection = this.osmConnection diff --git a/UI/BigComponents/SelectedElementView.svelte b/UI/BigComponents/SelectedElementView.svelte index e5607975d2..9bf83d432c 100644 --- a/UI/BigComponents/SelectedElementView.svelte +++ b/UI/BigComponents/SelectedElementView.svelte @@ -20,7 +20,6 @@ onDestroy(tags.addCallbackAndRun(tags => { _tags = tags; })); - console.log(layer.titleIcons.map(tr => tr.id)); let _metatags: Record; onDestroy(state.userRelatedState.preferencesAsTags.addCallbackAndRun(tags => { @@ -41,7 +40,7 @@
{#each layer.titleIcons as titleIconConfig} - {#if titleIconConfig.IsKnown(_tags)} + {#if ( titleIconConfig.condition?.matchesProperties(_tags) ?? true) && (titleIconConfig.metacondition?.matchesProperties(_tags) ?? true) && titleIconConfig.IsKnown(_tags)}
diff --git a/assets/layers/icons/icons.json b/assets/layers/icons/icons.json index 7b420218b3..afcbb62f1c 100644 --- a/assets/layers/icons/icons.json +++ b/assets/layers/icons/icons.json @@ -100,7 +100,8 @@ "labels": [ "defaults" ], - "render": "{share_link()}" + "render": "{share_link()}", + "metacondition": "_supports_sharing=yes" }, { "id": "osmlink", @@ -123,4 +124,4 @@ } ], "mapRendering": null -} \ No newline at end of file +}