Skip to content

Commit 6061497

Browse files
committed
fix: lint errors in RecordingOverlay
1 parent d0dda87 commit 6061497

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/browser/components/ChatInput/RecordingOverlay.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ const SlidingWaveform: React.FC<SlidingWaveformProps> = (props) => {
104104
// Audio analysis refs (persist across renders)
105105
const audioContextRef = useRef<AudioContext | null>(null);
106106
const analyserRef = useRef<AnalyserNode | null>(null);
107-
const samplesRef = useRef<number[]>(new Array(NUM_SAMPLES).fill(0));
107+
const samplesRef = useRef<number[]>(new Array<number>(NUM_SAMPLES).fill(0));
108108
const animationFrameRef = useRef<number>(0);
109109
const lastSampleTimeRef = useRef<number>(0);
110110

@@ -142,11 +142,11 @@ const SlidingWaveform: React.FC<SlidingWaveformProps> = (props) => {
142142
analyserRef.current = analyser;
143143

144144
// Reset samples when starting
145-
samplesRef.current = new Array(NUM_SAMPLES).fill(0);
145+
samplesRef.current = new Array<number>(NUM_SAMPLES).fill(0);
146146
lastSampleTimeRef.current = performance.now();
147147

148148
return () => {
149-
audioContext.close();
149+
void audioContext.close();
150150
audioContextRef.current = null;
151151
analyserRef.current = null;
152152
};
@@ -171,8 +171,8 @@ const SlidingWaveform: React.FC<SlidingWaveformProps> = (props) => {
171171

172172
// Calculate RMS amplitude (0-1 range)
173173
let sum = 0;
174-
for (let i = 0; i < dataArray.length; i++) {
175-
const normalized = (dataArray[i] - 128) / 128; // -1 to 1
174+
for (const sample of dataArray) {
175+
const normalized = (sample - 128) / 128; // -1 to 1
176176
sum += normalized * normalized;
177177
}
178178
const rms = Math.sqrt(sum / dataArray.length);

0 commit comments

Comments
 (0)