From 8c3071ed1b08b05ec3c336faa7381d22651dc7ab Mon Sep 17 00:00:00 2001 From: Tangem Date: Sat, 27 Apr 2024 21:32:59 +0500 Subject: [PATCH] Updated on 2026-08-14 --- .../operations/CurrenciesStatusesOperations.kt | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/domain/tokens/src/main/kotlin/com/tangem/domain/tokens/operations/CurrenciesStatusesOperations.kt b/domain/tokens/src/main/kotlin/com/tangem/domain/tokens/operations/CurrenciesStatusesOperations.kt index fac9f7fc95..d12ca4c9ad 100644 --- a/domain/tokens/src/main/kotlin/com/tangem/domain/tokens/operations/CurrenciesStatusesOperations.kt +++ b/domain/tokens/src/main/kotlin/com/tangem/domain/tokens/operations/CurrenciesStatusesOperations.kt @@ -264,10 +264,18 @@ internal class CurrenciesStatusesOperations( var quotesRetrievingFailed = false val networksStatuses = maybeNetworkStatuses?.bind()?.toNonEmptySetOrNull() - val quotes = recover({ maybeQuotes?.bind()?.toNonEmptySetOrNull() }) { - quotesRetrievingFailed = true - null - } + val quotes: Set? = maybeQuotes?.fold( + ifLeft = { + quotesRetrievingFailed = true + null + }, + ifRight = { + it.ifEmpty { + quotesRetrievingFailed = true + null + } + }, + ) currencies.map { currency -> val quote = quotes?.firstOrNull { it.rawCurrencyId == currency.id.rawCurrencyId }