mirror of
https://codeberg.org/armin/noiz.git
synced 2026-09-01 14:00:54 +02:00
fix: play button resumes paused track instead of switching to selected track
This commit is contained in:
parent
b748056e81
commit
61cdc6fd53
1 changed files with 4 additions and 0 deletions
|
|
@ -1480,6 +1480,10 @@ audioElA.addEventListener('pause', onPause);
|
|||
audioElB.addEventListener('pause', onPause);
|
||||
playBtn.addEventListener('click', () => {
|
||||
if (tracks.length === 0) return;
|
||||
if (audio.paused && currentIndex >= 0) {
|
||||
audio.play().catch(() => {});
|
||||
return;
|
||||
}
|
||||
const selArr = [...selectedIndices];
|
||||
const sel = selArr.length > 0 ? selArr[0] : -1;
|
||||
if (sel >= 0 && sel !== currentIndex) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue