Skip to content

Open Source Wealth Management Software. Angular + NestJS + Prisma + Nx + TypeScript 🤍

Bugfix/fix user currency of public page (#761)

Thomas Kauleb0444603b6d
diff --git a/CHANGELOG.md b/CHANGELOG.md
index ebe008da7d..46f78f8eca 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+## Unreleased
+
+### Fixed
+
+- Fixed an issue with the user currency of the public page
+
## 1.127.0 - 16.03.2022
### Changed
diff --git a/apps/api/src/app/portfolio/portfolio.service-new.ts b/apps/api/src/app/portfolio/portfolio.service-new.ts
index f11909b85d..2ea49de8f2 100644
--- a/apps/api/src/app/portfolio/portfolio.service-new.ts
+++ b/apps/api/src/app/portfolio/portfolio.service-new.ts
@@ -307,7 +307,10 @@ export class PortfolioServiceNew {
const emergencyFund = new Big(
(user.Settings?.settings as UserSettings)?.emergencyFund ?? 0
);
- const userCurrency = this.request.user?.Settings?.currency ?? baseCurrency;
+ const userCurrency =
+ this.request.user?.Settings?.currency ??
+ user.Settings?.currency ??
+ baseCurrency;
const { orders, portfolioOrders, transactionPoints } =
await this.getTransactionPoints({
diff --git a/apps/api/src/app/portfolio/portfolio.service.ts b/apps/api/src/app/portfolio/portfolio.service.ts
index f7902a2d74..a00b0cabd8 100644
--- a/apps/api/src/app/portfolio/portfolio.service.ts
+++ b/apps/api/src/app/portfolio/portfolio.service.ts
@@ -298,7 +298,10 @@ export class PortfolioService {
const emergencyFund = new Big(
(user.Settings?.settings as UserSettings)?.emergencyFund ?? 0
);
- const userCurrency = this.request.user?.Settings?.currency ?? baseCurrency;
+ const userCurrency =
+ this.request.user?.Settings?.currency ??
+ user.Settings?.currency ??
+ baseCurrency;
const portfolioCalculator = new PortfolioCalculator(
this.currentRateService,
userCurrency