fix(editor): Don't log expected errors in `AudioWaveform` during unmount (#565)

* Update README.md

* fix(editor): Don't log expected errors in `AudioWaveform` during unmount

---------

Co-authored-by: Maze <167211895+mazeincoding@users.noreply.github.com>
Co-authored-by: Maze Winther <mazewinther@gmail.com>
This commit is contained in:
Danilo Arantes F. 2025-08-25 06:37:33 -03:00 committed by GitHub
parent a4f2273e25
commit 03e68e77a9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -67,8 +67,8 @@ const AudioWaveform: React.FC<AudioWaveformProps> = ({
});
newWaveSurfer.on("error", (err) => {
console.error("WaveSurfer error:", err);
if (mounted) {
console.error("WaveSurfer error:", err);
setError(true);
setIsLoading(false);
}
@ -76,8 +76,8 @@ const AudioWaveform: React.FC<AudioWaveformProps> = ({
await newWaveSurfer.load(audioUrl);
} catch (err) {
console.error("Failed to initialize WaveSurfer:", err);
if (mounted) {
console.error("Failed to initialize WaveSurfer:", err);
setError(true);
setIsLoading(false);
}