From b9f8ec30e6681c623162bb36e44df16934740b32 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Sat, 19 Sep 2026 22:36:55 -0700 Subject: Zaps: the sound can be switched off — from the held bolt or Settings → Nostr. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/zap-animation.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/zap-animation.js') 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'); -- cgit v1.2.3