Updated on 2026-08-14
This commit is contained in:
parent
b3974b010d
commit
7fcabe68fa
1 changed files with 12 additions and 9 deletions
|
|
@ -278,10 +278,11 @@ internal class OnrampMainComponentModel @Inject constructor(
|
|||
private fun handleQuoteResult(quotes: List<OnrampQuote>) {
|
||||
sendOnrampQuotesErrorAnalytic(quotes)
|
||||
|
||||
val quote = quotes.firstOrNull()
|
||||
val quote = quotes.firstOrNull { it !is OnrampQuote.Error }
|
||||
|
||||
if (quote == null) {
|
||||
_state.update { stateFactory.getErrorState() }
|
||||
lastAmount.value = BigDecimal.ZERO
|
||||
return
|
||||
}
|
||||
|
||||
|
|
@ -295,15 +296,17 @@ internal class OnrampMainComponentModel @Inject constructor(
|
|||
|
||||
val isBestProvider = quote == bestProvider && hasBestProvider
|
||||
|
||||
if (quote is OnrampQuote.Data && lastAmount.value != quote.fromAmount.value) {
|
||||
if (lastAmount.value != quote.fromAmount.value) {
|
||||
lastAmount.value = quote.fromAmount.value
|
||||
analyticsEventHandler.send(
|
||||
OnrampAnalyticsEvent.ProviderCalculated(
|
||||
providerName = quote.provider.info.name,
|
||||
tokenSymbol = params.cryptoCurrency.symbol,
|
||||
paymentMethod = quote.paymentMethod.name,
|
||||
),
|
||||
)
|
||||
if (quote is OnrampQuote.Data) {
|
||||
analyticsEventHandler.send(
|
||||
OnrampAnalyticsEvent.ProviderCalculated(
|
||||
providerName = quote.provider.info.name,
|
||||
tokenSymbol = params.cryptoCurrency.symbol,
|
||||
paymentMethod = quote.paymentMethod.name,
|
||||
),
|
||||
)
|
||||
}
|
||||
_state.update {
|
||||
amountStateFactory.getAmountSecondaryUpdatedState(
|
||||
quote = quote,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue