diff --git a/js/src/hooks/use-stream-autoplay.ts b/js/src/hooks/use-stream-autoplay.ts index 8574e27..7a74433 100644 --- a/js/src/hooks/use-stream-autoplay.ts +++ b/js/src/hooks/use-stream-autoplay.ts @@ -34,6 +34,8 @@ export function useStreamAutoplay( if (latestChild.created_by_human_id === userId) return; + if (useAutoplayStore.getState().muted) return; + if (latestChild.type === "text") { new Audio(beepSound).play().catch(() => {}); return; @@ -41,8 +43,6 @@ export function useStreamAutoplay( if (latestChild.type !== "media") return; - if (useAutoplayStore.getState().muted) return; - const particle = latestChild; const creator = network?.humans?.find((h) => h.id === particle.created_by_human_id); const senderName = creator?.email_prefix ?? particle.created_by_human_id;