From d8c0f10c06a6c3417de1ee323637feb3f9e489ae Mon Sep 17 00:00:00 2001 From: Will Hunt Date: Mon, 2 Dec 2024 13:35:40 +0000 Subject: [PATCH] lint --- src/room/CallEventAudioRenderer.tsx | 50 +++++++++++++++++++++-------- 1 file changed, 36 insertions(+), 14 deletions(-) diff --git a/src/room/CallEventAudioRenderer.tsx b/src/room/CallEventAudioRenderer.tsx index b9b3c0b6..4f8213cf 100644 --- a/src/room/CallEventAudioRenderer.tsx +++ b/src/room/CallEventAudioRenderer.tsx @@ -29,8 +29,8 @@ export function CallEventAudioRenderer({ vm: CallViewModel; }): ReactNode { const [effectSoundVolume] = useSetting(effectSoundVolumeSetting); - const callEntered = useRef<(HTMLAudioElement|null)[]>([]); - const callLeft = useRef<(HTMLAudioElement|null)[]>([]); + const callEntered = useRef<(HTMLAudioElement | null)[]>([]); + const callLeft = useRef<(HTMLAudioElement | null)[]>([]); useEffect(() => { if (effectSoundVolume === 0) { @@ -44,7 +44,7 @@ export function CallEventAudioRenderer({ ), ) .subscribe(({ joined }) => { - const availablePlayer = callEntered.current.find(v => v?.paused); + const availablePlayer = callEntered.current.find((v) => v?.paused); void availablePlayer?.play(); }); @@ -56,7 +56,7 @@ export function CallEventAudioRenderer({ ), ) .subscribe(() => { - const availablePlayer = callLeft.current.find(v => v?.paused); + const availablePlayer = callLeft.current.find((v) => v?.paused); void availablePlayer?.play(); }); @@ -68,8 +68,16 @@ export function CallEventAudioRenderer({ // Set volume. useEffect(() => { - callEntered.current.forEach(a => {if (a) {a.volume = effectSoundVolume}}); - callLeft.current.forEach(a => {if (a) {a.volume = effectSoundVolume}}); + callEntered.current.forEach((a) => { + if (a) { + a.volume = effectSoundVolume; + } + }); + callLeft.current.forEach((a) => { + if (a) { + a.volume = effectSoundVolume; + } + }); }, [callEntered, callLeft, effectSoundVolume]); // Do not render any audio elements if playback is disabled. Will save @@ -82,14 +90,28 @@ export function CallEventAudioRenderer({ // Will play as soon as it's mounted, which is what we want as this will // play when the call is entered. <> - {Array.from({length: CONCURRENT_AUDIO_CHANNELS}).map((_, index) => )} - {Array.from({length: CONCURRENT_AUDIO_CHANNELS}).map((_, index) => )} + {Array.from({ length: CONCURRENT_AUDIO_CHANNELS }).map((_, index) => ( + + ))} + {Array.from({ length: CONCURRENT_AUDIO_CHANNELS }).map((_, index) => ( + + ))} ); }