Bugfix/fix undefined currencies after creating an activity (#731)

* Fix issue with undefined currencies after creating an activity

* Update changelog
This commit is contained in:
Thomas Kaul 2022-03-01 21:32:19 +01:00 committed by GitHub
parent b3e58d182a
commit 5bb20f6d5f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 8 deletions

View File

@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added support for click in the portfolio proportion chart component - Added support for click in the portfolio proportion chart component
### Fixed
- Fixed an issue with undefined currencies after creating an activity
## 1.121.0 - 27.02.2022 ## 1.121.0 - 27.02.2022
### Added ### Added

View File

@ -93,6 +93,13 @@ export class OrderService {
data.SymbolProfile.connectOrCreate.create.symbol.toUpperCase(); data.SymbolProfile.connectOrCreate.create.symbol.toUpperCase();
} }
await this.dataGatheringService.gatherProfileData([
{
dataSource: data.dataSource,
symbol: data.SymbolProfile.connectOrCreate.create.symbol
}
]);
const isDraft = isAfter(data.date as Date, endOfToday()); const isDraft = isAfter(data.date as Date, endOfToday());
if (!isDraft) { if (!isDraft) {
@ -106,13 +113,6 @@ export class OrderService {
]); ]);
} }
this.dataGatheringService.gatherProfileData([
{
dataSource: data.dataSource,
symbol: data.SymbolProfile.connectOrCreate.create.symbol
}
]);
await this.cacheService.flush(); await this.cacheService.flush();
delete data.accountId; delete data.accountId;

View File

@ -114,6 +114,10 @@ export class ExchangeRateDataService {
aFromCurrency: string, aFromCurrency: string,
aToCurrency: string aToCurrency: string
) { ) {
if (aValue === 0) {
return 0;
}
const hasNaN = Object.values(this.exchangeRates).some((exchangeRate) => { const hasNaN = Object.values(this.exchangeRates).some((exchangeRate) => {
return isNaN(exchangeRate); return isNaN(exchangeRate);
}); });
@ -206,7 +210,7 @@ export class ExchangeRateDataService {
currencies = currencies.concat(customCurrencies); currencies = currencies.concat(customCurrencies);
} }
return uniq(currencies).sort(); return uniq(currencies).filter(Boolean).sort();
} }
private prepareCurrencyPairs(aCurrencies: string[]) { private prepareCurrencyPairs(aCurrencies: string[]) {