diff --git a/flottform/where-are-you-at/src/routes/+page.svelte b/flottform/where-are-you-at/src/routes/+page.svelte index 5320f16..277e5f7 100644 --- a/flottform/where-are-you-at/src/routes/+page.svelte +++ b/flottform/where-are-you-at/src/routes/+page.svelte @@ -63,12 +63,9 @@ $currentState = 'error'; }); }); - const copyLinkToClipboard = () => { - const flottformLink = (document.querySelector('.link-offer') as HTMLDivElement).innerText; - const copyToClipboardButton = document.querySelector( - '.copy-button-link-wrapper .copy-to-clipboard' - ) as HTMLButtonElement; - + const copyLinkToClipboard = (e: Event) => { + const copyToClipboardButton = e.target as HTMLButtonElement; + const flottformLink = (copyToClipboardButton.nextElementSibling as HTMLDivElement).innerText; navigator.clipboard .writeText(flottformLink) .then(() => { @@ -86,7 +83,7 @@ }; -
+
{#if $currentState === 'new'} - @@ -125,35 +124,3 @@ Error connecting to friend {/if}
- -