From eb0444603b6d8bc99d1cc3d942244548de394207 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Sat, 19 Mar 2022 09:25:20 +0100 Subject: [PATCH] Bugfix/fix user currency of public page (#761) * Fix user currency * Update changelog --- CHANGELOG.md | 6 ++++++ apps/api/src/app/portfolio/portfolio.service-new.ts | 5 ++++- apps/api/src/app/portfolio/portfolio.service.ts | 5 ++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ebe008da..46f78f8e 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 f11909b8..2ea49de8 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 f7902a2d..a00b0cab 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