Updated on 2026-08-14
This commit is contained in:
parent
2e14534db3
commit
66c6e8e34d
5 changed files with 82 additions and 16 deletions
|
|
@ -26,6 +26,7 @@ import com.tangem.utils.coroutines.CoroutineDispatcherProvider
|
|||
import com.tangem.utils.coroutines.runCatching
|
||||
import com.tangem.utils.isNullOrZero
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
import kotlinx.coroutines.flow.firstOrNull
|
||||
import kotlinx.coroutines.withContext
|
||||
|
||||
@Suppress("LongParameterList")
|
||||
|
|
@ -134,8 +135,10 @@ internal class DefaultRampManager(
|
|||
userWalletId: UserWalletId,
|
||||
cryptoCurrency: CryptoCurrency,
|
||||
): ExchangeableState {
|
||||
val asset = expressServiceLoader.getInitializationStatus(userWalletId).firstOrNull()
|
||||
?: return ExchangeableState.Error
|
||||
return withContext(dispatchers.io) {
|
||||
when (val asset = expressServiceLoader.getInitializationStatus(userWalletId).value) {
|
||||
when (asset) {
|
||||
is Lce.Error -> ExchangeableState.Error
|
||||
is Lce.Loading -> ExchangeableState.Loading
|
||||
is Lce.Content -> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue