fix: dont set current audio vol if not playing

This commit is contained in:
2024-07-22 11:35:33 +01:00
parent ddf4758713
commit a679995bd1

View File

@@ -119,7 +119,7 @@ playBtn.onclick = () => {
volumeSlider.oninput = () => { volumeSlider.oninput = () => {
maxVolume = volumeSlider.value; maxVolume = volumeSlider.value;
currentVolumeLabel.textContent = `${maxVolume}%`; currentVolumeLabel.textContent = `${maxVolume}%`;
if (!isFading) { if (!isFading && currentAudio) {
currentAudio.volume = maxVolume / 100; currentAudio.volume = maxVolume / 100;
currentVolume = maxVolume; currentVolume = maxVolume;
} }