From 7ff0d0ac955b88b03bbd878316270d49b894a026 Mon Sep 17 00:00:00 2001 From: Armin Date: Wed, 8 Jul 2026 16:39:44 +0200 Subject: [PATCH] fix: check pendingNextIndex in play/pause button handler after track deletion --- index.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/index.html b/index.html index d41194d..7b1a004 100644 --- a/index.html +++ b/index.html @@ -1397,6 +1397,10 @@ playBtn.addEventListener('click', () => { playTrack(sel); } else if (currentIndex < 0 && sel >= 0) { playTrack(sel); + } else if (currentIndex < 0 && pendingNextIndex >= 0) { + const idx = pendingNextIndex; + pendingNextIndex = -1; + playTrack(idx); } else if (currentIndex < 0) { playTrack(0); } else if (audio.paused) {