mirror of
https://github.com/antebudimir/feishin.git
synced 2025-12-31 10:03:33 +00:00
remove unused length in visualizer
This commit is contained in:
parent
dbf840b185
commit
9f5b4e5410
1 changed files with 0 additions and 24 deletions
|
|
@ -12,8 +12,6 @@ export const Visualizer = () => {
|
|||
const accent = useSettingsStore((store) => store.general.accent);
|
||||
const [motion, setMotion] = useState<AudioMotionAnalyzer>();
|
||||
|
||||
const [, setLength] = useState(500);
|
||||
|
||||
useEffect(() => {
|
||||
const { context, gain } = webAudio || {};
|
||||
if (gain && context && canvasRef.current && !motion) {
|
||||
|
|
@ -35,28 +33,6 @@ export const Visualizer = () => {
|
|||
return () => {};
|
||||
}, [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 (
|
||||
<div
|
||||
className={styles.container}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue