diff --git a/libs/ui/src/lib/holdings-table/holdings-table.component.html b/libs/ui/src/lib/holdings-table/holdings-table.component.html index 7c7f6b829..b41e618aa 100644 --- a/libs/ui/src/lib/holdings-table/holdings-table.component.html +++ b/libs/ui/src/lib/holdings-table/holdings-table.component.html @@ -77,7 +77,7 @@ @@ -101,7 +101,7 @@ @@ -122,7 +122,7 @@ @@ -144,7 +144,7 @@ [isCurrency]="true" [locale]="locale" [value]=" - isLoading ? undefined : element.netPerformanceWithCurrencyEffect + isLoading() ? undefined : element.netPerformanceWithCurrencyEffect " /> @@ -168,7 +168,7 @@ [isPercent]="true" [locale]="locale" [value]=" - isLoading + isLoading() ? undefined : element.netPerformancePercentWithCurrencyEffect " @@ -199,7 +199,7 @@ -@if (isLoading) { +@if (isLoading()) { (); public displayedColumns: string[] = []; public ignoreAssetSubClasses = [AssetSubClass.CASH]; - public isLoading = true; public routeQueryParams: Subscription; public readonly holdings = input.required(); + protected readonly isLoading = computed(() => !this.holdings()); + private readonly unsubscribeSubject = new Subject(); public ngOnChanges() { @@ -90,17 +92,11 @@ export class GfHoldingsTableComponent implements OnChanges, OnDestroy { this.displayedColumns.push('performanceInPercentage'); - this.isLoading = true; - this.dataSource = new MatTableDataSource(this.holdings()); this.dataSource.paginator = this.paginator; this.dataSource.sortingDataAccessor = getLowercase; this.dataSource.sort = this.sort; - - if (this.holdings()) { - this.isLoading = false; - } } public onOpenHoldingDialog({ dataSource, symbol }: AssetProfileIdentifier) {