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;
this.historicalDataItems = historicalData.map(
({ averagePrice, date, marketPrice }) => {
this.benchmarkDataItems.push({
date,
value: averagePrice
});
({ averagePrice, date, marketPrice, quantity }) => {
if (quantity) {
this.benchmarkDataItems.push({
date,
value: averagePrice
});
}
return {
date,
@ -427,15 +429,6 @@ export class GfHoldingDetailDialogComponent implements OnDestroy, OnInit {
this.benchmarkDataItems[0].value = this.averagePrice;
}
this.benchmarkDataItems = this.benchmarkDataItems.map(
({ date, value }) => {
return {
date,
value: value === 0 ? null : value
};
}
);
if (this.hasPermissionToReadMarketDataOfOwnAssetProfile) {
this.fetchMarketData();
}

Loading…
Cancel
Save