mirror of
https://codeberg.org/armin/noiz.git
synced 2026-09-01 05:50:52 +02:00
keep currently playing track alive when clearing playlist
This commit is contained in:
parent
8984f5a864
commit
5b97e1627e
1 changed files with 3 additions and 8 deletions
11
index.html
11
index.html
|
|
@ -1683,14 +1683,9 @@ isolateBtn.addEventListener('click', isolateTracks);
|
|||
deleteBtn.addEventListener('click', deleteTrack);
|
||||
clearBtn.addEventListener('click', () => {
|
||||
if (tracks.length === 0) return;
|
||||
if (currentIndex >= 0) {
|
||||
const current = tracks[currentIndex];
|
||||
tracks = [current];
|
||||
currentIndex = 0;
|
||||
} else {
|
||||
tracks = [];
|
||||
currentIndex = -1;
|
||||
}
|
||||
for (const t of tracks) URL.revokeObjectURL(t.url);
|
||||
tracks = [];
|
||||
currentIndex = -1;
|
||||
selectedIndices.clear();
|
||||
anchorTrack = null;
|
||||
renderTracks();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue