diff --git a/src/App/Header/Connect.svelte b/src/App/Header/Connect.svelte index 7ae15bcd6..908ad3917 100644 --- a/src/App/Header/Connect.svelte +++ b/src/App/Header/Connect.svelte @@ -16,8 +16,8 @@ icon = "clipboard-small"; }, 800); - function copyToClipboard(clipboard: string) { - void toClipboard(clipboard); + async function copyToClipboard(clipboard: string): Promise { + await toClipboard(clipboard); icon = "checkmark-small"; restoreIcon(); } @@ -181,8 +181,8 @@ { - copyToClipboard(command); + on:click={async () => { + await copyToClipboard(command); }}> {command}
@@ -199,9 +199,9 @@
{ + on:click={async () => { if ($sessionStore) { - copyToClipboard($sessionStore.publicKey); + await copyToClipboard($sessionStore.publicKey); } }}>
diff --git a/src/components/Clipboard.svelte b/src/components/Clipboard.svelte index 046b85f2b..3b4df10e5 100644 --- a/src/components/Clipboard.svelte +++ b/src/components/Clipboard.svelte @@ -19,12 +19,12 @@ icon = small ? "clipboard-small" : "clipboard"; }, 800); - const copy = () => { - void toClipboard(text); + async function copy() { + await toClipboard(text); dispatch("copied"); icon = small ? "checkmark-small" : "checkmark"; restoreIcon(); - }; + }