aboutsummaryrefslogtreecommitdiffstats
path: root/src/zap-animation.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-09-19 22:36:55 -0700
committerAdam Soltys <[email protected]>2026-09-19 22:36:55 -0700
commitb9f8ec30e6681c623162bb36e44df16934740b32 (patch)
tree4deeaa3f460f4e1af37b8968eed4fcff924bd4dc /src/zap-animation.js
parent1b142c92ce869a6ebe97825931ef3553255ba58e (diff)
downloadcoinosv3-b9f8ec30e6681c623162bb36e44df16934740b32.tar.gz
coinosv3-b9f8ec30e6681c623162bb36e44df16934740b32.zip
Zaps: the sound can be switched off — from the held bolt or Settings → Nostr.
A prefs flag (zapSound, absent = on) synced with the zap amount. The strike and the tally are unchanged; only the clip stays quiet, and the clip chunk is not even fetched while it's off. Co-Authored-By: Claude Fable 5.1 <[email protected]>
Diffstat (limited to 'src/zap-animation.js')
-rw-r--r--src/zap-animation.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/zap-animation.js b/src/zap-animation.js
index 20a6b60..d03285b 100644
--- a/src/zap-animation.js
+++ b/src/zap-animation.js
@@ -37,10 +37,11 @@ function tremblePost(id) {
}
}
-export function animateZap(sats, origin, postId) {
+export function animateZap(sats, origin, postId, withSound = true) {
// Warm: play inside the tap itself (the audio context resumes on a
// gesture). Cold: play when the chunk lands, if that's still soon enough.
- if (sound) sound.playZapSound();
+ if (!withSound) {} // switched off from the held-⚡ screen: the strike stays
+ else if (sound) sound.playZapSound();
else { const tappedAt = performance.now(); warmZapSound().then((m) => { if (m) m.playZapSound(tappedAt); }); }
try { tremblePost(postId); } catch {} // Optional motion must never block a zap.
const layer = document.createElement('div');