forked from MapComplete/MapComplete
Refactoring: simplify Copyable
This commit is contained in:
parent
74d3cc2176
commit
872464202a
1 changed files with 5 additions and 3 deletions
|
|
@ -12,10 +12,12 @@
|
||||||
export let state: ThemeViewState = undefined
|
export let state: ThemeViewState = undefined
|
||||||
|
|
||||||
async function shareCurrentLink() {
|
async function shareCurrentLink() {
|
||||||
|
const title = state?.theme?.title?.txt ?? "MapComplete";
|
||||||
|
const textToShow = state?.theme?.description?.txt ?? ""
|
||||||
await navigator.share({
|
await navigator.share({
|
||||||
title: Translations.W(state.layout.title)?.ConstructElement().textContent ?? "MapComplete",
|
title,
|
||||||
text: Translations.W(state.layout.description)?.ConstructElement().textContent ?? "",
|
text: textToShow,
|
||||||
url: text,
|
url: text, // We show some 'text'-content, which _probably_ is a valid URL
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue