Updated on 2026-08-14

This commit is contained in:
Tangem 2024-04-27 21:32:59 +05:00
parent f50a76da2d
commit 8c3071ed1b

View file

@ -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<Quote>? = maybeQuotes?.fold(
ifLeft = {
quotesRetrievingFailed = true
null
},
ifRight = {
it.ifEmpty {
quotesRetrievingFailed = true
null
}
},
)
currencies.map { currency ->
val quote = quotes?.firstOrNull { it.rawCurrencyId == currency.id.rawCurrencyId }