mirror of
https://github.com/vector-im/element-call.git
synced 2026-08-29 21:15:19 +00:00
lowercase soundMap
This commit is contained in:
@@ -13,7 +13,7 @@ import { GenericReaction, ReactionSet } from "../reactions";
|
|||||||
import { prefetchSounds, useAudioContext } from "../useAudioContext";
|
import { prefetchSounds, useAudioContext } from "../useAudioContext";
|
||||||
import { useLatest } from "../useLatest";
|
import { useLatest } from "../useLatest";
|
||||||
|
|
||||||
const SoundMap = Object.fromEntries([
|
const soundMap = Object.fromEntries([
|
||||||
...ReactionSet.filter((v) => v.sound !== undefined).map((v) => [
|
...ReactionSet.filter((v) => v.sound !== undefined).map((v) => [
|
||||||
v.name,
|
v.name,
|
||||||
v.sound!,
|
v.sound!,
|
||||||
@@ -41,7 +41,7 @@ export function ReactionsAudioRenderer(): ReactNode {
|
|||||||
// This is fine even if we load the component multiple times,
|
// This is fine even if we load the component multiple times,
|
||||||
// as the browser's cache should ensure once the media is loaded
|
// as the browser's cache should ensure once the media is loaded
|
||||||
// once that future fetches come via the cache.
|
// once that future fetches come via the cache.
|
||||||
setSoundCache(prefetchSounds(SoundMap));
|
setSoundCache(prefetchSounds(soundMap));
|
||||||
}, [shouldPlay]);
|
}, [shouldPlay]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -58,7 +58,7 @@ export function ReactionsAudioRenderer(): ReactNode {
|
|||||||
// Don't replay old reactions
|
// Don't replay old reactions
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (SoundMap[reactionName]) {
|
if (soundMap[reactionName]) {
|
||||||
audioEngineRef.current.playSound(reactionName);
|
audioEngineRef.current.playSound(reactionName);
|
||||||
} else {
|
} else {
|
||||||
// Fallback sounds.
|
// Fallback sounds.
|
||||||
|
|||||||
Reference in New Issue
Block a user