Skip to content

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

Bugfix/fix fallback to load currencies directly from data provider (#629)

Thomas Kaul1a4109ebaa1d
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 10b0c4d2ec..387ebb8bab 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 the fallback to load currencies directly from the data provider
+
## 1.103.0 - 13.01.2022
### Changed
diff --git a/apps/api/src/services/exchange-rate-data.service.ts b/apps/api/src/services/exchange-rate-data.service.ts
index e83516e277..f77f7ef79a 100644
--- a/apps/api/src/services/exchange-rate-data.service.ts
+++ b/apps/api/src/services/exchange-rate-data.service.ts
@@ -58,9 +58,9 @@ export class ExchangeRateDataService {
getYesterday()
);
- if (isEmpty(result)) {
+ if (Object.keys(result).length !== this.currencyPairs.length) {
// Load currencies directly from data provider as a fallback
- // if historical data is not yet available
+ // if historical data is not fully available
const historicalData = await this.dataProviderService.get(
this.currencyPairs.map(({ dataSource, symbol }) => {
return { dataSource, symbol };