fix spinner on TGs with no rules
This commit is contained in:
parent
185237cd01
commit
5c07b8c15a
3 changed files with 14 additions and 5 deletions
|
@ -1,7 +1,12 @@
|
|||
@let inc = inc$ | async;
|
||||
<mat-card class="incident" appearance="outlined">
|
||||
<div class="cardHdr">
|
||||
<h1>{{ inc?.name }} <a [href]="'/api/incident/'+incID+'.m3u'"><mat-icon>playlist_play</mat-icon></a></h1>
|
||||
<h1>
|
||||
{{ inc?.name }}
|
||||
<a [href]="'/api/incident/' + incID + '.m3u'"
|
||||
><mat-icon>playlist_play</mat-icon></a
|
||||
>
|
||||
</h1>
|
||||
<button mat-icon-button (click)="editIncident(incID)">
|
||||
<mat-icon>edit</mat-icon>
|
||||
</button>
|
||||
|
|
|
@ -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 ?? []);
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue