Updated on 2026-08-14
This commit is contained in:
commit
748eb88755
1 changed files with 3 additions and 3 deletions
|
|
@ -136,13 +136,13 @@ internal class DefaultRampManager(
|
|||
cryptoCurrency: CryptoCurrency,
|
||||
): ExchangeableState {
|
||||
return withContext(dispatchers.io) {
|
||||
val initializationStatus = expressServiceLoader.getInitializationStatus(userWalletId).firstOrNull()
|
||||
val asset = expressServiceLoader.getInitializationStatus(userWalletId).firstOrNull()
|
||||
?: return@withContext ExchangeableState.Loading
|
||||
when (initializationStatus) {
|
||||
when (asset) {
|
||||
is Lce.Error -> ExchangeableState.Error
|
||||
is Lce.Loading -> ExchangeableState.Loading
|
||||
is Lce.Content -> {
|
||||
val foundAsset = initializationStatus.getOrNull()?.find { cryptoCurrency.findAssetPredicate(it) }
|
||||
val foundAsset = asset.getOrNull()?.find { cryptoCurrency.findAssetPredicate(it) }
|
||||
foundAsset?.exchangeAvailable?.toExchangeableState() ?: ExchangeableState.AssetNotFound
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue