diff --git a/src/room/CallEventAudioRenderer.tsx b/src/room/CallEventAudioRenderer.tsx index d95b8574..f814e1ab 100644 --- a/src/room/CallEventAudioRenderer.tsx +++ b/src/room/CallEventAudioRenderer.tsx @@ -72,8 +72,8 @@ export function CallEventAudioRenderer({ ({ joined, ids }) => ids.length <= MAX_PARTICIPANT_COUNT_FOR_SOUND && joined.length > 0, ), - throttle((_) => interval(THROTTLE_SOUND_EFFECT_MS)), - debounce((_) => interval(DEBOUNCE_SOUND_EFFECT_MS)), + throttle(() => interval(THROTTLE_SOUND_EFFECT_MS)), + debounce(() => interval(DEBOUNCE_SOUND_EFFECT_MS)), ) .subscribe((prev) => { console.log("Playing join sound for", ...prev.joined, "|", prev); @@ -86,8 +86,8 @@ export function CallEventAudioRenderer({ ({ ids, left }) => ids.length <= MAX_PARTICIPANT_COUNT_FOR_SOUND && left.length > 0, ), - throttle((_) => interval(THROTTLE_SOUND_EFFECT_MS)), - debounce((_) => interval(DEBOUNCE_SOUND_EFFECT_MS)), + throttle(() => interval(THROTTLE_SOUND_EFFECT_MS)), + debounce(() => interval(DEBOUNCE_SOUND_EFFECT_MS)), ) .subscribe(() => { audioEngineCtx.playSound("left"); diff --git a/src/room/ReactionAudioRenderer.tsx b/src/room/ReactionAudioRenderer.tsx index 7f1ca6f7..607e4890 100644 --- a/src/room/ReactionAudioRenderer.tsx +++ b/src/room/ReactionAudioRenderer.tsx @@ -38,18 +38,13 @@ export function ReactionsAudioRenderer(): ReactNode { if (!shouldPlay) { return; } - const oldReactionSet = new Set( - Object.values(oldReactions).map((r) => r.name), - ); - for (const reactionName of new Set( - Object.values(reactions).map((r) => r.name), - )) { - if (oldReactionSet.has(reactionName)) { + for (const [sender, reaction] of Object.entries(reactions)) { + if (oldReactions[sender]) { // Don't replay old reactions return; } - if (SoundMap[reactionName]) { - audioEngineCtx.playSound(reactionName); + if (SoundMap[reaction.name]) { + audioEngineCtx.playSound(reaction.name); } else { // Fallback sounds. audioEngineCtx.playSound("generic");