This commit is contained in:
Daniel Ponte 2025-02-01 14:28:39 -05:00
parent 8a223b8897
commit c10070a52b
2 changed files with 9 additions and 7 deletions

View file

@ -1,7 +1,7 @@
import { Component, inject, Input, input, Sanitizer } from '@angular/core';
import { switchMap, tap } from 'rxjs/operators';
import { Component, inject, Input } from '@angular/core';
import { tap } from 'rxjs/operators';
import { CommonModule, Location } from '@angular/common';
import { BehaviorSubject, merge, Subscription } from 'rxjs';
import { BehaviorSubject, merge, Subject, Subscription } from 'rxjs';
import { Observable } from 'rxjs';
import {
ReactiveFormsModule,
@ -40,7 +40,6 @@ import { CallPlayerComponent } from '../../calls/player/call-player/call-player.
import { FmtDatePipe } from '../incidents.component';
import { MatMenuModule } from '@angular/material/menu';
import { Share } from '../../share/share.service';
import { toObservable } from '@angular/core/rxjs-interop';
export interface EditDialogData {
incID: string;
@ -153,7 +152,7 @@ export class IncidentEditDialogComponent {
styleUrl: './incident.component.scss',
})
export class IncidentComponent {
incPrime = new BehaviorSubject<IncidentRecord>(<IncidentRecord>{});
incPrime = new Subject<IncidentRecord>();
inc$!: Observable<IncidentRecord>;
@Input() incident?: Share;
subscriptions: Subscription = new Subscription();
@ -196,7 +195,7 @@ export class IncidentComponent {
}
this.inc$ = merge(incOb, this.incPrime).pipe(
tap((inc) => {
if (inc.calls) {
if (inc && inc.calls) {
this.callsResult.data = inc.calls;
}
}),

View file

@ -1,6 +1,9 @@
@let sh = share | async;
@if (sh == null) {
<h1 class="error">Share invalid!</h1>
} @else if (sh.shareType == "incident") {
<app-incident [incident]="sh"></app-incident>
} @else if (sh.shareType == "call") {
} @else {}
} @else {
<h1 class="error">Share type {{sh.shareType}} unknown</h1>
}