Handle empty portfolio

pull/239/head
Thomas 3 years ago
parent c8c21a016a
commit ec5523b459

@ -411,6 +411,13 @@ export class PortfolioService {
const transactionPoints = await this.getTransactionPoints(userId); const transactionPoints = await this.getTransactionPoints(userId);
if (transactionPoints?.length <= 0) {
return {
hasErrors: false,
positions: []
};
}
portfolioCalculator.setTransactionPoints(transactionPoints); portfolioCalculator.setTransactionPoints(transactionPoints);
const portfolioStart = parseDate(transactionPoints[0].date); const portfolioStart = parseDate(transactionPoints[0].date);

Loading…
Cancel
Save