Bugfix/fix spike of positions with differing currency of user (#248)
* Convert market price back to currency of position * Update changelog
This commit is contained in:
parent
b7d950f3f9
commit
94d2310217
@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
- Fixed the missing market state in the positions tab
|
- Fixed the missing market state in the positions tab
|
||||||
|
- Fixed the chart of positions with differing currency from user
|
||||||
|
|
||||||
## 1.31.1 - 01.08.2021
|
## 1.31.1 - 01.08.2021
|
||||||
|
|
||||||
|
@ -300,11 +300,17 @@ export class PortfolioService {
|
|||||||
currency,
|
currency,
|
||||||
firstBuyDate,
|
firstBuyDate,
|
||||||
investment,
|
investment,
|
||||||
marketPrice,
|
|
||||||
quantity,
|
quantity,
|
||||||
transactionCount
|
transactionCount
|
||||||
} = position;
|
} = position;
|
||||||
|
|
||||||
|
// Convert market price back to currency of position
|
||||||
|
const marketPrice = this.exchangeRateDataService.toCurrency(
|
||||||
|
position.marketPrice,
|
||||||
|
this.request.user.Settings.currency,
|
||||||
|
currency
|
||||||
|
);
|
||||||
|
|
||||||
const historicalData = await this.dataProviderService.getHistorical(
|
const historicalData = await this.dataProviderService.getHistorical(
|
||||||
[aSymbol],
|
[aSymbol],
|
||||||
'day',
|
'day',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user