Browse Source

Holding detail dialog: show null average unit price when held quantity of the asset is not null

pull/4793/head
bptrgx 1 month ago
parent
commit
1c56d9a644
  1. 21
      apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.component.ts

21
apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.component.ts

@ -275,11 +275,13 @@ export class GfHoldingDetailDialogComponent implements OnDestroy, OnInit {
SymbolProfile?.userId === this.user?.id; SymbolProfile?.userId === this.user?.id;
this.historicalDataItems = historicalData.map( this.historicalDataItems = historicalData.map(
({ averagePrice, date, marketPrice }) => { ({ averagePrice, date, marketPrice, quantity }) => {
this.benchmarkDataItems.push({ if (quantity) {
date, this.benchmarkDataItems.push({
value: averagePrice date,
}); value: averagePrice
});
}
return { return {
date, date,
@ -427,15 +429,6 @@ export class GfHoldingDetailDialogComponent implements OnDestroy, OnInit {
this.benchmarkDataItems[0].value = this.averagePrice; this.benchmarkDataItems[0].value = this.averagePrice;
} }
this.benchmarkDataItems = this.benchmarkDataItems.map(
({ date, value }) => {
return {
date,
value: value === 0 ? null : value
};
}
);
if (this.hasPermissionToReadMarketDataOfOwnAssetProfile) { if (this.hasPermissionToReadMarketDataOfOwnAssetProfile) {
this.fetchMarketData(); this.fetchMarketData();
} }

Loading…
Cancel
Save