mirror of
https://github.com/vector-im/element-call.git
synced 2026-08-29 21:15:19 +00:00
Fix generic sound not playing.
This commit is contained in:
@@ -9,7 +9,7 @@ import { ReactNode, useEffect, useRef } from "react";
|
|||||||
|
|
||||||
import { useReactions } from "../useReactions";
|
import { useReactions } from "../useReactions";
|
||||||
import { playReactionsSound, useSetting } from "../settings/settings";
|
import { playReactionsSound, useSetting } from "../settings/settings";
|
||||||
import { ReactionSet } from "../reactions";
|
import { GenericReaction, ReactionSet } from "../reactions";
|
||||||
|
|
||||||
export function ReactionsAudioRenderer(): ReactNode {
|
export function ReactionsAudioRenderer(): ReactNode {
|
||||||
const { reactions } = useReactions();
|
const { reactions } = useReactions();
|
||||||
@@ -27,7 +27,8 @@ export function ReactionsAudioRenderer(): ReactNode {
|
|||||||
for (const reactionName of new Set(
|
for (const reactionName of new Set(
|
||||||
Object.values(reactions).map((r) => r.name),
|
Object.values(reactions).map((r) => r.name),
|
||||||
)) {
|
)) {
|
||||||
const audioElement = audioElements.current[reactionName];
|
const audioElement =
|
||||||
|
audioElements.current[reactionName] ?? audioElements.current.generic;
|
||||||
if (audioElement?.paused) {
|
if (audioElement?.paused) {
|
||||||
void audioElement.play();
|
void audioElement.play();
|
||||||
}
|
}
|
||||||
@@ -45,7 +46,7 @@ export function ReactionsAudioRenderer(): ReactNode {
|
|||||||
// be delayed.
|
// be delayed.
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{ReactionSet.map(
|
{[GenericReaction, ...ReactionSet].map(
|
||||||
(r) =>
|
(r) =>
|
||||||
r.sound && (
|
r.sound && (
|
||||||
<audio
|
<audio
|
||||||
|
|||||||
Reference in New Issue
Block a user