From 0d3044c5e6b33f1a07cfe520e085146282fe1b58 Mon Sep 17 00:00:00 2001 From: wukko Date: Wed, 5 Mar 2025 18:07:46 +0600 Subject: [PATCH] web: add haptics for all copy actions & prevent spamming the copy action along with haptic feedback :3 should probably unify all of this cuz this is really messy --- web/src/components/dialog/SavingDialog.svelte | 8 ++++++-- web/src/components/donate/DonateAltItem.svelte | 8 ++++++-- web/src/components/donate/DonateShareCard.svelte | 8 ++++++-- web/src/components/misc/SectionHeading.svelte | 10 +++++++--- web/src/components/settings/SettingsCategory.svelte | 2 -- web/src/lib/haptics.ts | 11 +++++++++-- 6 files changed, 34 insertions(+), 13 deletions(-) diff --git a/web/src/components/dialog/SavingDialog.svelte b/web/src/components/dialog/SavingDialog.svelte index 03127353..05b9b083 100644 --- a/web/src/components/dialog/SavingDialog.svelte +++ b/web/src/components/dialog/SavingDialog.svelte @@ -2,6 +2,7 @@ import { t } from "$lib/i18n/translations"; import { device } from "$lib/device"; + import { hapticConfirm } from "$lib/haptics"; import { copyURL, openURL, @@ -101,8 +102,11 @@ fill elevated click={async () => { - copyURL(url); - copied = true; + if (!copied) { + copyURL(url); + hapticConfirm(); + copied = true; + } }} ariaLabel={copied ? $t("button.copied") : ""} > diff --git a/web/src/components/donate/DonateAltItem.svelte b/web/src/components/donate/DonateAltItem.svelte index cbc8e684..4724e249 100644 --- a/web/src/components/donate/DonateAltItem.svelte +++ b/web/src/components/donate/DonateAltItem.svelte @@ -1,5 +1,6 @@