From b8533050b0c68c41ed138d61ff362631e5650861 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Mon, 1 Apr 2024 09:22:35 +0200 Subject: [PATCH] Bugfix/fix duplicated tags in position detail dialog (#3224) * Fix duplicated tags * Update changelog --- CHANGELOG.md | 4 ++++ apps/api/src/app/portfolio/portfolio.service.ts | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a0b55060..7da7e2f93 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Improved the usability of the date range support by specific years (`2023`, `2022`, `2021`, etc.) in the assistant (experimental) - Introduced a factory for the portfolio calculations to support different algorithms in future +### Fixed + +- Fixed the duplicated tags in the position detail dialog + ## 2.69.0 - 2024-03-30 ### Added diff --git a/apps/api/src/app/portfolio/portfolio.service.ts b/apps/api/src/app/portfolio/portfolio.service.ts index 566ad4049..0bdafec48 100644 --- a/apps/api/src/app/portfolio/portfolio.service.ts +++ b/apps/api/src/app/portfolio/portfolio.service.ts @@ -719,8 +719,6 @@ export class PortfolioService { { dataSource: aDataSource, symbol: aSymbol } ]); - tags = uniqBy(tags, 'id'); - const portfolioCalculator = this.calculatorFactory.createCalculator({ activities: orders.filter((order) => { tags = tags.concat(order.tags); @@ -731,6 +729,8 @@ export class PortfolioService { currency: userCurrency }); + tags = uniqBy(tags, 'id'); + const portfolioStart = portfolioCalculator.getStartDate(); const transactionPoints = portfolioCalculator.getTransactionPoints();