Refactoring: simplify Copyable

This commit is contained in:
Pieter Vander Vennet 2025-07-12 19:05:05 +02:00
parent 74d3cc2176
commit 872464202a

View file

@ -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
}) })
} }