From 0ed0e53d883562feebc1277da750e0b589941844 Mon Sep 17 00:00:00 2001 From: bptrgx <47859535+bptrgx@users.noreply.github.com> Date: Fri, 7 Jul 2023 12:20:16 +0200 Subject: [PATCH] Fix https://github.com/ghostfolio/ghostfolio/pull/2123#discussion_r1254464234 --- .../position-detail-dialog.component.ts | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/apps/client/src/app/components/position/position-detail-dialog/position-detail-dialog.component.ts b/apps/client/src/app/components/position/position-detail-dialog/position-detail-dialog.component.ts index f914d0c16..e796cabb3 100644 --- a/apps/client/src/app/components/position/position-detail-dialog/position-detail-dialog.component.ts +++ b/apps/client/src/app/components/position/position-detail-dialog/position-detail-dialog.component.ts @@ -113,17 +113,13 @@ export class PositionDetailDialog implements OnDestroy, OnInit { this.grossPerformancePercent = grossPerformancePercent; this.historicalDataItems = historicalData.map( (historicalDataItem) => { - if (historicalDataItem.averagePrice) { - this.benchmarkDataItems.push({ - date: historicalDataItem.date, - value: historicalDataItem.averagePrice - }); - } else { - this.benchmarkDataItems.push({ - date: historicalDataItem.date, - value: null - }); - } + this.benchmarkDataItems.push({ + date: historicalDataItem.date, + value: + historicalDataItem.averagePrice > 0 + ? historicalDataItem.averagePrice + : null + }); return { date: historicalDataItem.date,