diff --git a/src/routes/_api/player/audio.tsx b/src/routes/_api/player/audio.tsx index d91f64b..da2ca54 100644 --- a/src/routes/_api/player/audio.tsx +++ b/src/routes/_api/player/audio.tsx @@ -133,6 +133,7 @@ const CoverArt = ({ src, alt }: { src?: string; alt: string }) => { const [current, setCurrent] = useState(src); const [previous, setPrevious] = useState(); const currentRef = useRef(src); + const hasSwappedRef = useRef(false); const timerRef = useRef | null>(null); useEffect(() => { @@ -143,6 +144,7 @@ const CoverArt = ({ src, alt }: { src?: string; alt: string }) => { const start = () => { if (cancelled || begun) return; begun = true; + hasSwappedRef.current = true; setPrevious(currentRef.current); currentRef.current = src; setCurrent(src); @@ -186,7 +188,7 @@ const CoverArt = ({ src, alt }: { src?: string; alt: string }) => {