diff --git a/Logic/State/UserRelatedState.ts b/Logic/State/UserRelatedState.ts index 529420a2b..ceccfc2fd 100644 --- a/Logic/State/UserRelatedState.ts +++ b/Logic/State/UserRelatedState.ts @@ -259,7 +259,7 @@ export default class UserRelatedState { _theme: layout?.id, _backend: this.osmConnection.Backend(), _applicationOpened: new Date().toISOString(), - _supports_sharing: "yes" // TODO window.navigator.share ? "yes" : "no" + _supports_sharing: window.navigator.share ? "yes" : "no" }) for (const key in Constants.userJourney) { diff --git a/UI/Base/ShareButton.svelte b/UI/Base/ShareButton.svelte index 9078815f3..16286d11c 100644 --- a/UI/Base/ShareButton.svelte +++ b/UI/Base/ShareButton.svelte @@ -9,13 +9,12 @@ export let generateShareData: () => { url: string } function share(){ - alert("Sharing...") if (!navigator.share) { console.log("web share not supported") return; } navigator - .share(this._shareData()) + .share(generateShareData()) .then(() => { console.log("Thanks for sharing!") }) diff --git a/UI/Popup/ShareLinkViz.ts b/UI/Popup/ShareLinkViz.ts index 7246c7e8f..23d19bb92 100644 --- a/UI/Popup/ShareLinkViz.ts +++ b/UI/Popup/ShareLinkViz.ts @@ -1,8 +1,6 @@ -import { UIEventSource } from "../../Logic/UIEventSource" +import {UIEventSource} from "../../Logic/UIEventSource" import LayerConfig from "../../Models/ThemeConfig/LayerConfig" -import Svg from "../../Svg" -import { FixedUiElement } from "../Base/FixedUiElement" -import { SpecialVisualization, SpecialVisualizationState } from "../SpecialVisualization"; +import {SpecialVisualization, SpecialVisualizationState} from "../SpecialVisualization"; import SvelteUIElement from "../Base/SvelteUIElement"; import ShareButton from "../Base/ShareButton.svelte"; @@ -46,6 +44,5 @@ export class ShareLinkViz implements SpecialVisualization { } return new SvelteUIElement(ShareButton, {generateShareData}) - //return new ShareButton(Svg.share_svg().SetClass("w-8 h-8"), generateShareData) } }