mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-09 01:16:15 -08:00
fix(dashboard): keep other EPG scopes when one is retired mid-tick
forkJoin emits nothing when one input completes without a value, which is exactly what the EPG source-change guard does to an in-flight lookup. One retired or failing scope would therefore blank every other scope's answer for that tick; each group now contributes an empty map instead. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
14d45b9c4c
commit
6579151dcf
1 file changed
+34
-2
+34
-2
@@ -8,7 +8,16 @@ import {
|
||||
untracked,
|
||||
} from '@angular/core';
|
||||
import { toObservable, toSignal } from '@angular/core/rxjs-interop';
|
||||
import { forkJoin, interval, map, of, startWith, switchMap } from 'rxjs';
|
||||
import {
|
||||
catchError,
|
||||
defaultIfEmpty,
|
||||
forkJoin,
|
||||
interval,
|
||||
map,
|
||||
of,
|
||||
startWith,
|
||||
switchMap,
|
||||
} from 'rxjs';
|
||||
import { EpgService } from '@iptvnator/epg/data-access';
|
||||
import {
|
||||
type EpgProgram,
|
||||
@@ -340,7 +349,30 @@ export class WorkspaceDashboardRailsComponent {
|
||||
map((programs) => ({
|
||||
scopeKey: group.scopeKey,
|
||||
programs,
|
||||
}))
|
||||
})),
|
||||
// One scope retired by an EPG
|
||||
// source change, or failing,
|
||||
// must not blank every other
|
||||
// scope's answer for the tick:
|
||||
// `forkJoin` emits nothing at
|
||||
// all when one input completes
|
||||
// empty.
|
||||
defaultIfEmpty({
|
||||
scopeKey: group.scopeKey,
|
||||
programs: new Map<
|
||||
string,
|
||||
EpgProgram | null
|
||||
>(),
|
||||
}),
|
||||
catchError(() =>
|
||||
of({
|
||||
scopeKey: group.scopeKey,
|
||||
programs: new Map<
|
||||
string,
|
||||
EpgProgram | null
|
||||
>(),
|
||||
})
|
||||
)
|
||||
)
|
||||
)
|
||||
).pipe(
|
||||
|
||||
Reference in new issue
Block a user