Browse Source

resolve comments

pull/7996/head
KenTandrian 2 weeks ago
parent
commit
c83ad2c02f
  1. 14
      apps/client/src/app/components/account-detail-dialog/account-detail-dialog.component.ts
  2. 3
      apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts

14
apps/client/src/app/components/account-detail-dialog/account-detail-dialog.component.ts

@ -365,11 +365,15 @@ export class GfAccountDetailDialogComponent implements OnInit {
portfolioPerformance.chart.length > 0
) {
this.historicalDataItems = portfolioPerformance.chart
.map(({ date, netWorth, netWorthInPercentage }) => ({
date,
value: isNumber(netWorth) ? netWorth : netWorthInPercentage
}))
.filter((item): item is LineChartItem => isNumber(item.value));
.map(({ date, netWorth, netWorthInPercentage }) => {
return {
date,
value: isNumber(netWorth) ? netWorth : netWorthInPercentage
};
})
.filter((item): item is LineChartItem => {
return isNumber(item.value);
});
} else {
this.historicalDataItems = this.accountBalances.map(
({ date, valueInBaseCurrency }) => {

3
apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts

@ -7,7 +7,6 @@ import {
} from '@ghostfolio/common/config';
import { canOpenHoldingDetail } from '@ghostfolio/common/helper';
import {
HistoricalDataItem,
InvestmentItem,
LineChartItem,
PortfolioInvestmentsResponse,
@ -80,7 +79,7 @@ import { forkJoin } from 'rxjs';
})
export class GfAnalysisPageComponent implements OnInit {
protected benchmark?: Partial<SymbolProfile>;
protected benchmarkDataItems: HistoricalDataItem[] = [];
protected benchmarkDataItems: LineChartItem[] = [];
protected readonly benchmarks: Partial<SymbolProfile>[];
protected bottom3: PortfolioPosition[];
protected dividendsByGroup: InvestmentItem[];

Loading…
Cancel
Save