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:
parent
a4f2273e25
commit
03e68e77a9
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue