From 576abb2a8d5f6951f40d09e2cbcddfb96bc35189 Mon Sep 17 00:00:00 2001 From: Timo Date: Thu, 5 Jun 2025 15:18:36 +0200 Subject: [PATCH] fix lint --- src/useAudioContext.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/useAudioContext.tsx b/src/useAudioContext.tsx index be882103..00cea2fc 100644 --- a/src/useAudioContext.tsx +++ b/src/useAudioContext.tsx @@ -18,6 +18,7 @@ import { } from "./livekit/MediaDevicesContext"; import { type PrefetchedSounds } from "./soundUtils"; import { useUrlParams } from "./UrlParams"; +import { useInitial } from "./useInitial"; /** * Play a sound though a given AudioContext. Will take @@ -59,7 +60,6 @@ interface Props { interface UseAudioContext { playSound(soundName: S): Promise; - htmlAudioElement: HTMLAudioElement; } /** @@ -77,7 +77,7 @@ export function useAudioContext( const [audioContext, setAudioContext] = useState(); const [audioBuffers, setAudioBuffers] = useState>(); - const [htmlAudioElement] = useState((): HTMLAudioElement => new Audio()); + const htmlAudioElement = useInitial((): HTMLAudioElement => new Audio()); useEffect(() => { const sounds = props.sounds; @@ -141,6 +141,5 @@ export function useAudioContext( earpiecePan, ); }, - htmlAudioElement, }; }