Skip to content

best way to save what you love

web/DonateShareCard: hide share button if user agent doesn't support it

wukkoffea8e6f2e69
diff --git a/web/src/components/donate/DonateShareCard.svelte b/web/src/components/donate/DonateShareCard.svelte
index 87ec2109..a2c3221e 100644
--- a/web/src/components/donate/DonateShareCard.svelte
+++ b/web/src/components/donate/DonateShareCard.svelte
@@ -13,6 +13,7 @@
import CobaltQr from "$lib/icons/CobaltQR.svelte";
import CopyIcon from "$components/misc/CopyIcon.svelte";
+ import { device } from "$lib/device";
const cobaltUrl = "https://cobalt.tools/";
@@ -50,16 +51,18 @@
copy
</button>
- <button
- id="action-button-share"
- class="action-button"
- on:click={async () => shareURL(cobaltUrl)}
- >
- <div class="action-button-icon">
- <IconShare2 />
- </div>
- {$t("button.share")}
- </button>
+ {#if device.supports.share}
+ <button
+ id="action-button-share"
+ class="action-button"
+ on:click={async () => shareURL(cobaltUrl)}
+ >
+ <div class="action-button-icon">
+ <IconShare2 />
+ </div>
+ {$t("button.share")}
+ </button>
+ {/if}
<button
id="action-button-github"