maybe a good fix this time...

This commit is contained in:
2024-01-05 02:44:55 +01:00
parent 2869de4861
commit 5847e8de7a

View File

@@ -59,6 +59,7 @@
onMount(async () => { onMount(async () => {
const volumeData = localStorage.getItem('volume'); const volumeData = localStorage.getItem('volume');
volume = volumeData ? parseFloat(volumeData) : 0.67; volume = volumeData ? parseFloat(volumeData) : 0.67;
setVolume(volume);
}); });
$: updateCurrentSong(currentTime, $currentSongIndex); $: updateCurrentSong(currentTime, $currentSongIndex);
@@ -77,9 +78,6 @@
} else { } else {
audio.volume = volume; audio.volume = volume;
} }
console.log(volume);
console.log(audio.volume);
} }
// workaround for bug https://github.com/sveltejs/svelte/issues/5347 // workaround for bug https://github.com/sveltejs/svelte/issues/5347
@@ -154,14 +152,7 @@
<button <button
class="material-icons" class="material-icons"
style="--icon-color:{iconColor}" style="--icon-color:{iconColor}"
on:click={() => { on:click={() => (audio.paused ? audio.play() : audio.pause())}
if (audio.paused) {
console.log(audio.volume);
audio.play();
} else {
audio.pause();
}
}}
> >
{#if paused} {#if paused}
play_arrow play_arrow