Updated on 2026-08-14

This commit is contained in:
Tangem 2024-06-03 18:01:04 +04:00
parent 388ad1cf30
commit b538cc76e1

View file

@ -13,6 +13,7 @@ import com.tangem.domain.tokens.repository.CurrenciesRepository
import com.tangem.domain.tokens.repository.NetworksRepository
import com.tangem.domain.tokens.repository.QuotesRepository
import com.tangem.domain.wallets.models.UserWalletId
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.flow.*
internal class CurrenciesStatusesLceOperations(
@ -35,11 +36,12 @@ internal class CurrenciesStatusesLceOperations(
)
}
@OptIn(ExperimentalCoroutinesApi::class)
private fun transformToCurrenciesStatuses(
userWalletId: UserWalletId,
flow: LceFlow<TokenListError, List<CryptoCurrency>>,
): LceFlow<TokenListError, List<CryptoCurrencyStatus>> {
return flow.transform transform@{ maybeCurrencies ->
return flow.transformLatest transform@{ maybeCurrencies ->
val nonEmptyCurrencies = maybeCurrencies.fold(
ifLoading = { maybeContent ->
emit(createLoadingCurrenciesStatuses(maybeContent))