From 5c07b8c15aebc6e6a6fb503f601ee0b123add94c Mon Sep 17 00:00:00 2001 From: Daniel Ponte Date: Sat, 11 Jan 2025 16:42:18 -0500 Subject: [PATCH] fix spinner on TGs with no rules --- .../src/app/incidents/incident/incident.component.html | 7 ++++++- .../talkgroup-record/talkgroup-record.component.ts | 7 ++++--- client/stillbox/src/app/talkgroups/talkgroups.service.ts | 5 ++++- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/client/stillbox/src/app/incidents/incident/incident.component.html b/client/stillbox/src/app/incidents/incident/incident.component.html index d742ca8..e9b8612 100644 --- a/client/stillbox/src/app/incidents/incident/incident.component.html +++ b/client/stillbox/src/app/incidents/incident/incident.component.html @@ -1,7 +1,12 @@ @let inc = inc$ | async;
-

{{ inc?.name }} playlist_play

+

+ {{ inc?.name }} + playlist_play +

diff --git a/client/stillbox/src/app/talkgroups/talkgroup-record/talkgroup-record.component.ts b/client/stillbox/src/app/talkgroups/talkgroup-record/talkgroup-record.component.ts index 269acac..ae0937c 100644 --- a/client/stillbox/src/app/talkgroups/talkgroup-record/talkgroup-record.component.ts +++ b/client/stillbox/src/app/talkgroups/talkgroup-record/talkgroup-record.component.ts @@ -158,9 +158,10 @@ export class TalkgroupRecordComponent { .getTalkgroup(Number(this.tgid.sys), Number(this.tgid.tg)) .pipe( tap((tg) => { - tg.alert_rules = tg.alert_rules.map((x) => - Object.assign(new AlertRule(), x), - ); + console.log('tap run'); + tg.alert_rules = tg.alert_rules + ? tg.alert_rules.map((x) => Object.assign(new AlertRule(), x)) + : []; this.form.patchValue(tg); this.form.controls['tagInput'].setValue(''); this.form.controls['tagsControl'].setValue(this.tg?.tags ?? []); diff --git a/client/stillbox/src/app/talkgroups/talkgroups.service.ts b/client/stillbox/src/app/talkgroups/talkgroups.service.ts index 7a41161..0896b64 100644 --- a/client/stillbox/src/app/talkgroups/talkgroups.service.ts +++ b/client/stillbox/src/app/talkgroups/talkgroups.service.ts @@ -33,7 +33,10 @@ export class TalkgroupService { private subscriptions = new Subscription(); constructor(private http: HttpClient) { this.tgs$ = this.fetchAll.pipe(switchMap(() => this.getTalkgroups())); - this.tags$ = this.fetchAll.pipe(switchMap(() => this.getAllTags()), shareReplay()); + this.tags$ = this.fetchAll.pipe( + switchMap(() => this.getAllTags()), + shareReplay(), + ); this.fillTgMap(); }