Updated on 2026-08-14

This commit is contained in:
Tangem 2024-12-03 20:24:37 +05:00
parent b5a54b0e29
commit 7190b70fd0
2 changed files with 10 additions and 7 deletions

View file

@ -55,7 +55,10 @@ internal class DefaultOnrampMainComponent @AssistedInject constructor(
context = childByContext(componentContext),
params = ConfirmResidencyComponent.Params(
country = config.country,
onDismiss = { model.bottomSheetNavigation.dismiss() },
onDismiss = {
model.bottomSheetNavigation.dismiss()
model.handleOnrampAvailable(it.defaultCurrency)
},
),
)
is OnrampMainBottomSheetConfig.CurrenciesList -> selectCurrencyComponentFactory.create(

View file

@ -88,6 +88,12 @@ internal class OnrampMainComponentModel @Inject constructor(
)
}
fun handleOnrampAvailable(currency: OnrampCurrency) {
_state.update { stateFactory.getReadyState(currency) }
subscribeToCurrencyUpdates()
subscribeToQuotesUpdate()
}
fun onProviderSelected(providerWithQuote: OnrampProviderWithQuote.Data) {
_state.update { amountStateFactory.getAmountSecondaryUpdatedState(providerWithQuote) }
}
@ -109,12 +115,6 @@ internal class OnrampMainComponentModel @Inject constructor(
}
}
private fun handleOnrampAvailable(currency: OnrampCurrency) {
_state.update { stateFactory.getReadyState(currency) }
subscribeToCurrencyUpdates()
subscribeToQuotesUpdate()
}
private fun subscribeToCurrencyUpdates() {
getOnrampCurrencyUseCase.invoke()
.onEach { maybeCurrency ->