remove unused length in visualizer

This commit is contained in:
Kendall Garner 2025-06-24 21:20:41 -07:00
parent dbf840b185
commit 9f5b4e5410
No known key found for this signature in database
GPG key ID: 9355F387FE765C94

View file

@ -12,8 +12,6 @@ export const Visualizer = () => {
const accent = useSettingsStore((store) => store.general.accent); const accent = useSettingsStore((store) => store.general.accent);
const [motion, setMotion] = useState<AudioMotionAnalyzer>(); const [motion, setMotion] = useState<AudioMotionAnalyzer>();
const [, setLength] = useState(500);
useEffect(() => { useEffect(() => {
const { context, gain } = webAudio || {}; const { context, gain } = webAudio || {};
if (gain && context && canvasRef.current && !motion) { if (gain && context && canvasRef.current && !motion) {
@ -35,28 +33,6 @@ export const Visualizer = () => {
return () => {}; return () => {};
}, [accent, canvasRef, motion, webAudio]); }, [accent, canvasRef, motion, webAudio]);
const resize = useCallback(() => {
const body = document.querySelector('.full-screen-player-queue-container');
const header = document.querySelector('.full-screen-player-queue-header');
if (body && header) {
const width = body.clientWidth - 30;
const height = body.clientHeight - header.clientHeight - 30;
setLength(Math.min(width, height));
}
}, []);
useEffect(() => {
resize();
window.addEventListener('resize', resize);
return () => {
window.removeEventListener('resize', resize);
};
}, [resize]);
return ( return (
<div <div
className={styles.container} className={styles.container}