Browse Source

Fix: Update footer row visibility logic and handle performance data safely

pull/5027/head
Dan 7 days ago
parent
commit
3fab10fee2
  1. 2
      libs/ui/src/lib/holdings-table/holdings-table.component.html
  2. 10
      libs/ui/src/lib/holdings-table/holdings-table.component.ts

2
libs/ui/src/lib/holdings-table/holdings-table.component.html

@ -252,7 +252,7 @@
<tr
*matFooterRowDef="displayedColumns"
mat-footer-row
[ngClass]="{ 'd-none': isLoading }"
[ngClass]="{ 'd-none': isLoading || !performance }"
></tr>
</table>
</div>

10
libs/ui/src/lib/holdings-table/holdings-table.component.ts

@ -96,10 +96,12 @@ export class GfHoldingsTableComponent implements OnChanges, OnDestroy {
this.dataSource = new MatTableDataSource(this.holdings);
this.dataSource.paginator = this.paginator;
this.dataSource.sort = this.sort;
this.totalValue = this.performance.currentValueInBaseCurrency;
this.totalChange = this.performance.netPerformanceWithCurrencyEffect;
this.totalChangePercentage =
this.performance.netPerformancePercentageWithCurrencyEffect;
if (this.performance) {
this.totalValue = this.performance?.currentValueInBaseCurrency;
this.totalChange = this.performance?.netPerformanceWithCurrencyEffect;
this.totalChangePercentage =
this.performance?.netPerformancePercentageWithCurrencyEffect;
}
if (this.holdings) {
this.isLoading = false;

Loading…
Cancel
Save