diff --git a/src/lib/components/AudioViz.svelte b/src/lib/components/AudioViz.svelte index 85f8e27..e61fa7b 100644 --- a/src/lib/components/AudioViz.svelte +++ b/src/lib/components/AudioViz.svelte @@ -12,7 +12,7 @@ let waveformElement; let playing = false; - $: if (wavesurfer && audioSrc) { + $: if (wavesurfer && audioSrc && peaks.length > 0) { updateWaveSurfer(); } @@ -34,28 +34,19 @@ wavesurfer.on('finish', () => { playing = false; }); - - updateWaveSurfer(); } function updateWaveSurfer() { - if (wavesurfer && audioSrc) { - if (peaks.length > 0) { - wavesurfer.load(audioSrc, peaks); - } - resetPlayState(); - } + createWaveSurfer(); + wavesurfer.empty(); // This clears the waveform + wavesurfer.load(audioSrc, peaks); + resetPlayState(); } function resetPlayState() { playing = false; - if (wavesurfer) { - wavesurfer.stop(); // This stops and resets the wavesurfer progress - wavesurfer.empty(); // This clears the waveform - if (peaks.length > 0) { - wavesurfer.load(audioSrc, peaks); // Reload the current audio - } - } + wavesurfer.stop(); // This stops and resets the wavesurfer progress + // wavesurfer.empty(); // This clears the waveform } function togglePlayPause() { diff --git a/src/lib/components/SettingsPane.svelte b/src/lib/components/SettingsPane.svelte index 48bda65..afc8aa2 100644 --- a/src/lib/components/SettingsPane.svelte +++ b/src/lib/components/SettingsPane.svelte @@ -91,7 +91,7 @@ success = false; } } - currSettings = await getSettings(); + // currSettings = getSettings(); updating = false; } diff --git a/src/lib/components/StatusSpinner.svelte b/src/lib/components/StatusSpinner.svelte new file mode 100644 index 0000000..cead4af --- /dev/null +++ b/src/lib/components/StatusSpinner.svelte @@ -0,0 +1,9 @@ + + +