forked from MapComplete/MapComplete
Fix: share button
This commit is contained in:
parent
cbc4e6eb15
commit
84cbd2fbc0
3 changed files with 4 additions and 8 deletions
|
@ -259,7 +259,7 @@ export default class UserRelatedState {
|
||||||
_theme: layout?.id,
|
_theme: layout?.id,
|
||||||
_backend: this.osmConnection.Backend(),
|
_backend: this.osmConnection.Backend(),
|
||||||
_applicationOpened: new Date().toISOString(),
|
_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) {
|
for (const key in Constants.userJourney) {
|
||||||
|
|
|
@ -9,13 +9,12 @@ export let generateShareData: () => {
|
||||||
url: string
|
url: string
|
||||||
}
|
}
|
||||||
function share(){
|
function share(){
|
||||||
alert("Sharing...")
|
|
||||||
if (!navigator.share) {
|
if (!navigator.share) {
|
||||||
console.log("web share not supported")
|
console.log("web share not supported")
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
navigator
|
navigator
|
||||||
.share(this._shareData())
|
.share(generateShareData())
|
||||||
.then(() => {
|
.then(() => {
|
||||||
console.log("Thanks for sharing!")
|
console.log("Thanks for sharing!")
|
||||||
})
|
})
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
import { UIEventSource } from "../../Logic/UIEventSource"
|
import {UIEventSource} from "../../Logic/UIEventSource"
|
||||||
import LayerConfig from "../../Models/ThemeConfig/LayerConfig"
|
import LayerConfig from "../../Models/ThemeConfig/LayerConfig"
|
||||||
import Svg from "../../Svg"
|
import {SpecialVisualization, SpecialVisualizationState} from "../SpecialVisualization";
|
||||||
import { FixedUiElement } from "../Base/FixedUiElement"
|
|
||||||
import { SpecialVisualization, SpecialVisualizationState } from "../SpecialVisualization";
|
|
||||||
import SvelteUIElement from "../Base/SvelteUIElement";
|
import SvelteUIElement from "../Base/SvelteUIElement";
|
||||||
import ShareButton from "../Base/ShareButton.svelte";
|
import ShareButton from "../Base/ShareButton.svelte";
|
||||||
|
|
||||||
|
@ -46,6 +44,5 @@ export class ShareLinkViz implements SpecialVisualization {
|
||||||
}
|
}
|
||||||
|
|
||||||
return new SvelteUIElement(ShareButton, {generateShareData})
|
return new SvelteUIElement(ShareButton, {generateShareData})
|
||||||
//return new ShareButton(Svg.share_svg().SetClass("w-8 h-8"), generateShareData)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue