From 7e71701e106d5df6280f8ebad83ed5f1e33b504a Mon Sep 17 00:00:00 2001 From: wukko Date: Wed, 5 Mar 2025 22:19:08 +0600 Subject: [PATCH] web/SmallDialog: add error haptics to error popups --- web/src/components/dialog/SmallDialog.svelte | 6 ++++++ web/src/lib/haptics.ts | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/web/src/components/dialog/SmallDialog.svelte b/web/src/components/dialog/SmallDialog.svelte index bce93be4..6767612c 100644 --- a/web/src/components/dialog/SmallDialog.svelte +++ b/web/src/components/dialog/SmallDialog.svelte @@ -1,4 +1,5 @@ diff --git a/web/src/lib/haptics.ts b/web/src/lib/haptics.ts index 347e81bc..87c87f22 100644 --- a/web/src/lib/haptics.ts +++ b/web/src/lib/haptics.ts @@ -33,3 +33,11 @@ export const hapticConfirm = () => { hapticSwitch(); setTimeout(() => hapticSwitch(), 120); } + +export const hapticError = () => { + if (!canUseHaptics()) return; + + hapticSwitch(); + setTimeout(() => hapticSwitch(), 120); + setTimeout(() => hapticSwitch(), 240); +}