From ab177361d7d549e701ec40694c2646a00fca6ba6 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Fri, 7 Aug 2026 20:52:30 +0200 Subject: [PATCH] Refactoring --- apps/api/src/app/portfolio/portfolio.service.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/apps/api/src/app/portfolio/portfolio.service.ts b/apps/api/src/app/portfolio/portfolio.service.ts index e4b0ca60a..80a46b39a 100644 --- a/apps/api/src/app/portfolio/portfolio.service.ts +++ b/apps/api/src/app/portfolio/portfolio.service.ts @@ -1136,19 +1136,19 @@ export class PortfolioService { withSummary: true }); - const hasOpenHoldings = Object.keys(holdings).length > 0; - - const emergencyFundHoldingsValueInBaseCurrency = - this.getEmergencyFundHoldingsValueInBaseCurrency({ holdings }); - - const emergencyFundInBaseCurrency = userSettings.emergencyFund ?? 0; - const { balanceInBaseCurrency: cashBalanceInBaseCurrency } = await this.accountService.getCashDetails({ userId, currency: this.getUserCurrency() }); + const emergencyFundInBaseCurrency = userSettings.emergencyFund ?? 0; + + const emergencyFundHoldingsValueInBaseCurrency = + this.getEmergencyFundHoldingsValueInBaseCurrency({ holdings }); + + const hasOpenHoldings = Object.keys(holdings).length > 0; + const marketsAdvancedTotalInBaseCurrency = getSum( Object.values(marketsAdvanced).map(({ valueInBaseCurrency }) => { return new Big(valueInBaseCurrency);