From a679995bd18c4d3b1e5d3cd74074df350819b5ff Mon Sep 17 00:00:00 2001 From: Kenneth Date: Mon, 22 Jul 2024 11:35:33 +0100 Subject: [PATCH] fix: dont set current audio vol if not playing --- web/script.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/script.js b/web/script.js index 529ead7..03ee6be 100644 --- a/web/script.js +++ b/web/script.js @@ -119,7 +119,7 @@ playBtn.onclick = () => { volumeSlider.oninput = () => { maxVolume = volumeSlider.value; currentVolumeLabel.textContent = `${maxVolume}%`; - if (!isFading) { + if (!isFading && currentAudio) { currentAudio.volume = maxVolume / 100; currentVolume = maxVolume; }