fix: disk usage state and cava bar count

This commit is contained in:
Pihkaal
2024-08-22 18:26:15 +02:00
parent dd6c5faa5a
commit e7c405ca1d
3 changed files with 7 additions and 5 deletions

View File

@@ -66,7 +66,7 @@ const InnerCava = (props: InnerKittyProps<typeof Cava>) => {
const analyserRef = useRef<AnalyserNode | null>(null);
const audioContextRef = useRef<AudioContext | null>(null);
const [barHeights, setBarHeights] = useState(
new Array<number>(Math.round(props.cols / 3)).fill(0),
new Array<number>(Math.floor(props.cols / 3)).fill(0),
);
const requestRef = useRef<number>();
@@ -77,7 +77,7 @@ const InnerCava = (props: InnerKittyProps<typeof Cava>) => {
const dataArray = new Uint8Array(bufferLength);
analyserRef.current.getByteFrequencyData(dataArray);
const barCount = Math.round(props.cols / 3);
const barCount = Math.floor(props.cols / 3);
const newBarHeights = [];
for (let i = 0; i < barCount; i++) {