wip
This commit is contained in:
parent
0035828965
commit
086bb90064
1 changed files with 3 additions and 10 deletions
|
@ -26,7 +26,6 @@ export interface TalkgroupsPaginated {
|
|||
providedIn: 'root',
|
||||
})
|
||||
export class TalkgroupService {
|
||||
private readonly _getTalkgroup = new Map<string, ReplaySubject<Talkgroup>>();
|
||||
private tgs$: Observable<Talkgroup[]>;
|
||||
private tags$!: Observable<string[]>;
|
||||
private fetchAll = new BehaviorSubject<'fetch'>('fetch');
|
||||
|
@ -50,16 +49,10 @@ export class TalkgroupService {
|
|||
}
|
||||
|
||||
getTalkgroup(sys: number, tg: number): Observable<Talkgroup> {
|
||||
const key = this.tgKey(sys, tg);
|
||||
if (!this._getTalkgroup.get(key)) {
|
||||
return this.tgs$.pipe(
|
||||
switchMap((talkg) =>
|
||||
talkg.filter((tgv) => tgv.tgid == tg && tgv.system_id == sys),
|
||||
),
|
||||
switchMap((tgs) => tgs.filter(t => t.system_id === sys && t.tgid === tg))
|
||||
);
|
||||
}
|
||||
return this._getTalkgroup.get(key)!;
|
||||
}
|
||||
|
||||
putTalkgroup(tu: TalkgroupUpdate): Observable<Talkgroup> {
|
||||
let tgid = this.tgKey(tu.system_id, tu.tgid);
|
||||
|
|
Loading…
Reference in a new issue