mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-14 21:26:15 -08:00
fix(workspace): keep the overlay delay while another playlist refreshes
Refresh preparation skipped the cached-load delay for any playlist, so opening a cached portal while another playlist prepared a refresh still flashed the overlay. Only preparation of the shown playlist (any on the dashboard) now shows it at once. Also words the J2 layout-shift history from #1895 in the past tense: the cached-load overlay no longer mounts on a J2 click. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
eef1e58142
commit
daf00268bd
4 files changed
+34
-13
No files matched your search
+10
@@ -153,6 +153,16 @@ describe('WorkspaceShellXtreamImportService', () => {
|
||||
expect(service.showXtreamImportOverlay()).toBe(true);
|
||||
});
|
||||
|
||||
it('keeps the delay while another playlist prepares a refresh', () => {
|
||||
refreshPreparation.set({ playlistId: 'other-playlist' });
|
||||
activeImportSessionId.set('session-1');
|
||||
advance(0);
|
||||
expect(service.showXtreamImportOverlay()).toBe(false);
|
||||
|
||||
advance(XTREAM_LOCAL_LOAD_OVERLAY_DELAY_MS);
|
||||
expect(service.showXtreamImportOverlay()).toBe(true);
|
||||
});
|
||||
|
||||
it('shows the overlay at once while a refresh prepares the playlist', () => {
|
||||
refreshPreparation.set({ playlistId: 'portal-1' });
|
||||
expect(service.showXtreamImportOverlay()).toBe(true);
|
||||
|
||||
+18
-8
@@ -109,15 +109,25 @@ export class WorkspaceShellXtreamImportService {
|
||||
|
||||
/**
|
||||
* Remote imports (the store flags `isImporting` for every phase except
|
||||
* `loading-cached`) and refresh preparation show the overlay at once. A
|
||||
* session that has only read the saved catalog so far waits
|
||||
* `XTREAM_LOCAL_LOAD_OVERLAY_DELAY_MS`, so a warm open never flashes it.
|
||||
* `loading-cached`) and refresh preparation of the shown playlist (any
|
||||
* on the dashboard) show the overlay at once. A session that has only
|
||||
* read the saved catalog so far waits `XTREAM_LOCAL_LOAD_OVERLAY_DELAY_MS`,
|
||||
* so a warm open never flashes it, even while another playlist prepares
|
||||
* a refresh.
|
||||
*/
|
||||
private readonly isOverlayImmediate = computed(
|
||||
() =>
|
||||
Boolean(this.refreshPreparation()) ||
|
||||
this.xtreamStore.isImporting()
|
||||
);
|
||||
private readonly isOverlayImmediate = computed(() => {
|
||||
if (this.xtreamStore.isImporting()) {
|
||||
return true;
|
||||
}
|
||||
if (this.routeState.currentRoute().kind === 'dashboard') {
|
||||
return Boolean(this.refreshPreparation());
|
||||
}
|
||||
const playlistId = this.routeState.currentContext()?.playlistId;
|
||||
return (
|
||||
playlistId !== undefined &&
|
||||
this.isRefreshPreparationRunningForPlaylist(playlistId)
|
||||
);
|
||||
});
|
||||
private readonly localLoadDelayElapsed = signal(false);
|
||||
|
||||
readonly showXtreamImportOverlay = computed(
|
||||
|
||||
Reference in new issue
Block a user