Updated on 2026-08-14

This commit is contained in:
Tangem 2026-01-27 16:46:19 +04:00
parent e432a6b69e
commit 035a094201

View file

@ -14,6 +14,7 @@ import com.tangem.features.yield.supply.api.YieldSupplyEntryComponent
import com.tangem.features.yield.supply.api.entry.YieldSupplyEntryRoute
import com.tangem.utils.coroutines.CoroutineDispatcherProvider
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
import timber.log.Timber
import javax.inject.Inject
@ -43,11 +44,15 @@ internal class YieldSupplyEntryModel @Inject constructor(
cryptoCurrencyId = cryptoCurrency.id,
).onLeft { error ->
Timber.e("Failed to get CryptoCurrencyStatus: $error")
router.pop()
withContext(dispatchers.mainImmediate) {
router.pop()
}
}.onRight { cryptoCurrencyStatus ->
val route = getInitialRoute(cryptoCurrencyStatus)
if (route != null) {
router.replaceCurrent(route)
withContext(dispatchers.mainImmediate) {
val route = getInitialRoute(cryptoCurrencyStatus)
if (route != null) {
router.replaceCurrent(route)
}
}
}
}