fix: avoid beep sound on text messages when autoplay disabled
This commit is contained in:
@@ -34,6 +34,8 @@ export function useStreamAutoplay(
|
|||||||
|
|
||||||
if (latestChild.created_by_human_id === userId) return;
|
if (latestChild.created_by_human_id === userId) return;
|
||||||
|
|
||||||
|
if (useAutoplayStore.getState().muted) return;
|
||||||
|
|
||||||
if (latestChild.type === "text") {
|
if (latestChild.type === "text") {
|
||||||
new Audio(beepSound).play().catch(() => {});
|
new Audio(beepSound).play().catch(() => {});
|
||||||
return;
|
return;
|
||||||
@@ -41,8 +43,6 @@ export function useStreamAutoplay(
|
|||||||
|
|
||||||
if (latestChild.type !== "media") return;
|
if (latestChild.type !== "media") return;
|
||||||
|
|
||||||
if (useAutoplayStore.getState().muted) return;
|
|
||||||
|
|
||||||
const particle = latestChild;
|
const particle = latestChild;
|
||||||
const creator = network?.humans?.find((h) => h.id === particle.created_by_human_id);
|
const creator = network?.humans?.find((h) => h.id === particle.created_by_human_id);
|
||||||
const senderName = creator?.email_prefix ?? particle.created_by_human_id;
|
const senderName = creator?.email_prefix ?? particle.created_by_human_id;
|
||||||
|
|||||||
Reference in New Issue
Block a user