Handle empty portfolio

pull/239/head
Thomas 3 years ago
parent 9821b7f8f0
commit c8c21a016a

@ -456,6 +456,19 @@ export class PortfolioService {
const transactionPoints = await this.getTransactionPoints(userId);
if (transactionPoints?.length <= 0) {
return {
hasErrors: false,
performance: {
currentGrossPerformance: 0,
currentGrossPerformancePercent: 0,
currentNetPerformance: 0,
currentNetPerformancePercent: 0,
currentValue: 0
}
};
}
portfolioCalculator.setTransactionPoints(transactionPoints);
const portfolioStart = parseDate(transactionPoints[0].date);

Loading…
Cancel
Save