mirror of
https://github.com/vector-im/element-call.git
synced 2026-08-08 20:09:19 +00:00
only play one sound per reaction type
This commit is contained in:
@@ -38,13 +38,18 @@ export function ReactionsAudioRenderer(): ReactNode {
|
|||||||
if (!shouldPlay) {
|
if (!shouldPlay) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for (const [sender, reaction] of Object.entries(reactions)) {
|
const oldReactionSet = new Set(
|
||||||
if (oldReactions[sender]) {
|
Object.values(oldReactions).map((r) => r.name),
|
||||||
|
);
|
||||||
|
for (const reactionName of new Set(
|
||||||
|
Object.values(reactions).map((r) => r.name),
|
||||||
|
)) {
|
||||||
|
if (oldReactionSet.has(reactionName)) {
|
||||||
// Don't replay old reactions
|
// Don't replay old reactions
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (SoundMap[reaction.name]) {
|
if (SoundMap[reactionName]) {
|
||||||
audioEngineCtx.playSound(reaction.name);
|
audioEngineCtx.playSound(reactionName);
|
||||||
} else {
|
} else {
|
||||||
// Fallback sounds.
|
// Fallback sounds.
|
||||||
audioEngineCtx.playSound("generic");
|
audioEngineCtx.playSound("generic");
|
||||||
|
|||||||
Reference in New Issue
Block a user