fix(web/m7-364): pause on last-track remove + reset drawer in test setup
This commit is contained in:
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user