fix(web/m7-364): pause on last-track remove + reset drawer in test setup

This commit is contained in:
2026-05-03 20:37:33 -04:00
parent 6f9b5d0059
commit bde017dad3
2 changed files with 39 additions and 2 deletions
+12 -2
View File
@@ -283,8 +283,18 @@ export function removeFromQueue(idx: number): void {
_error = null;
return;
}
// _index stays — now points at what was the next track.
if (_index >= next.length) _index = next.length - 1;
if (_index >= next.length) {
// Removed the last track. Mirror skipNext end-of-queue behaviour:
// pause on the now-last remaining track at position 0 — don't
// auto-play a track the user already heard.
_index = next.length - 1;
_state = 'paused';
_position = 0;
_duration = 0;
_error = null;
return;
}
// _index stays — now points at what was the next track. Advance into it.
_position = 0;
_duration = 0;
_state = 'loading';