fix(portals): count a pending Stalker start for its own series only

A start still resolving its stream for a series the view has since left
no longer keeps the new series' reset row disabled.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
4grayandClaude Fable 5.1 committed 2026-10-03 11:57:31 +02:00
1 parent aaae2b0572
commit 4e17c0533b
1 file changed
+16 -5
@@ -283,8 +283,11 @@ export class StalkerSeriesViewComponent implements OnDestroy {
private unsubscribePositionUpdates: (() => void) | null = null;
readonly openingEpisodeId = signal<number | null>(null);
readonly activeEpisodeId = signal<number | null>(null);
/** Starts still resolving their stream (`create_link` round trips). */
private readonly pendingStartCount = signal(0);
/**
* Series ids of starts still resolving their stream (`create_link`
* round trips): only the series on screen counts as starting.
*/
private readonly pendingStartSeriesIds = signal<readonly string[]>([]);
readonly seasonWatchBatchRunning = signal(false);
/**
@@ -401,7 +404,9 @@ export class StalkerSeriesViewComponent implements OnDestroy {
),
playbackActive: computed(
() =>
this.pendingStartCount() > 0 ||
this.pendingStartSeriesIds().includes(
String(this.displayItem()?.id ?? '')
) ||
this.inlinePlayback() !== null ||
this.openingEpisodeId() !== null ||
this.activeEpisodeId() !== null
@@ -1269,7 +1274,8 @@ export class StalkerSeriesViewComponent implements OnDestroy {
};
if (request.usesEmbeddedPlayer && !request.identity) return;
this.pendingStartCount.update((count) => count + 1);
const pendingSeriesId = String(this.displayItem()?.id ?? '');
this.pendingStartSeriesIds.update((ids) => [...ids, pendingSeriesId]);
try {
const playback = await this.stalkerStore.resolveVodPlayback(
cmd,
@@ -1323,7 +1329,12 @@ export class StalkerSeriesViewComponent implements OnDestroy {
duration: 3000,
});
} finally {
this.pendingStartCount.update((count) => count - 1);
this.pendingStartSeriesIds.update((ids) => {
const index = ids.indexOf(pendingSeriesId);
return index < 0
? ids
: [...ids.slice(0, index), ...ids.slice(index + 1)];
});
}
}