Skip to content

Commit

Permalink
#189 - fix excessive timeseries wavesurfer recreation due to bad pale…
Browse files Browse the repository at this point in the history
…tte comparison
  • Loading branch information
rewbs committed Jul 27, 2023
1 parent 69a109d commit f355beb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/WavesurferWaveform.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const WavesurferAudioWaveform = ({ audioBuffer, initialSelection, onSelectionCha
useEffect(() => {

// Recreate wavesurfer iff the audio buffer or color scheme has changed
if (audioBuffer !== prevAudioBuffer || palette !== prevPalette) {
if (audioBuffer !== prevAudioBuffer || palette.mode !== prevPalette?.mode) {
if (waveSurferRef.current) {
waveSurferRef.current.destroy();
waveSurferRef.current = null;
Expand Down

0 comments on commit f355beb

Please sign in to comment.