diff --git a/web/src/lib/player/store.svelte.ts b/web/src/lib/player/store.svelte.ts index 01e12442..bce1c43a 100644 --- a/web/src/lib/player/store.svelte.ts +++ b/web/src/lib/player/store.svelte.ts @@ -144,8 +144,7 @@ export function playQueue( // rotation-aware order, so no client shuffle in that path). _queueSource = opts.source ?? null; // #968: a fresh play replaces the self-heal closure + resets its budget. - const refetch = opts.refetch; - _queueRefetch = refetch ? () => refetch().then(playable) : null; + _queueRefetch = opts.refetch ?? null; _selfHealAttempts = 0; // Start on the chosen track's place in the playable list; if the chosen // one is missing, that place holds the next playable track after it. @@ -376,7 +375,8 @@ function trySelfHeal(): boolean { _error = null; const refetch = _queueRefetch; void refetch() - .then((refs) => { + .then((fetched) => { + const refs = playable(fetched); if (refs.length > 0) { // Re-seed in place — keep _queueSource / _queueRefetch so the new // snapshot can itself self-heal, and don't reset _selfHealAttempts