From 546be943ee3c6aa802c64dbd434baa8536b4c8d2 Mon Sep 17 00:00:00 2001 From: Alvaro <110414366+alvaro-signal@users.noreply.github.com> Date: Mon, 6 Mar 2023 10:30:03 -0700 Subject: [PATCH] Fixed render loop on voice notes draft --- ts/components/CompositionRecordingDraft.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ts/components/CompositionRecordingDraft.tsx b/ts/components/CompositionRecordingDraft.tsx index b5f15ddf1a..25c7c7a955 100644 --- a/ts/components/CompositionRecordingDraft.tsx +++ b/ts/components/CompositionRecordingDraft.tsx @@ -137,9 +137,10 @@ function SizedWaveformScrubber({ onScrub, width, }: SizedWaveformScrubberProps) { - const handleCorrupted = () => { + const handleCorrupted = useCallback(() => { log.warn('SizedWaveformScrubber: audio corrupted'); - }; + }, []); + const { peaks, duration } = useComputePeaks({ audioUrl, activeDuration,