Updated on 2026-08-14

This commit is contained in:
Tangem 2025-12-10 12:25:49 +01:00
parent 30613125f8
commit 3451c40021
2 changed files with 5 additions and 3 deletions

View file

@ -17,14 +17,15 @@ internal class OnrampOffersStateFactory(
fun getOffersState(offers: List<OnrampOffersBlock>): OnrampV2MainComponentUM {
val currentState = currentStateProvider.invoke()
return when (currentState) {
is OnrampV2MainComponentUM.InitialLoading -> currentState
is OnrampV2MainComponentUM.Content -> {
if (currentState.offersBlockState is OnrampOffersBlockUM.Loading && offers.isEmpty()) {
return currentState
}
currentState.copy(
offersBlockState = mapOnrampOffersBlockToUM(offersBlocks = offers),
)
}
is OnrampV2MainComponentUM.InitialLoading -> {
currentState
}
}
}

View file

@ -64,6 +64,7 @@ internal class OnrampV2AmountStateFactory(
currencySymbol = currency.unit,
onAmountValueChanged = onrampIntents::onAmountValueChanged,
),
offersBlockState = OnrampOffersBlockUM.Loading,
)
}