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

* Fix user currency

* Update changelog
This commit is contained in:
Thomas Kaul 2022-03-19 09:25:20 +01:00 committed by GitHub
parent 6e582fe505
commit eb0444603b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 2 deletions

View File

@ -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/), 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). 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 ## 1.127.0 - 16.03.2022
### Changed ### Changed

View File

@ -307,7 +307,10 @@ export class PortfolioServiceNew {
const emergencyFund = new Big( const emergencyFund = new Big(
(user.Settings?.settings as UserSettings)?.emergencyFund ?? 0 (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 } = const { orders, portfolioOrders, transactionPoints } =
await this.getTransactionPoints({ await this.getTransactionPoints({

View File

@ -298,7 +298,10 @@ export class PortfolioService {
const emergencyFund = new Big( const emergencyFund = new Big(
(user.Settings?.settings as UserSettings)?.emergencyFund ?? 0 (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( const portfolioCalculator = new PortfolioCalculator(
this.currentRateService, this.currentRateService,
userCurrency userCurrency