Updated on 2026-08-14

This commit is contained in:
Tangem 2026-03-20 01:37:34 -07:00
parent 2070f1d21c
commit 8ca7bc0ca7
15 changed files with 132 additions and 53 deletions

View file

@ -14,6 +14,7 @@ import com.tangem.core.navigation.url.UrlOpener
import com.tangem.domain.models.kyc.KycStatus
import com.tangem.domain.models.wallet.UserWalletId
import com.tangem.domain.pay.TangemPayEligibilityManager
import com.tangem.domain.pay.model.TangemPayEntryPoint
import com.tangem.domain.pay.repository.OnboardingRepository
import com.tangem.domain.pay.usecase.ProduceTangemPayInitialDataUseCase
import com.tangem.domain.tangempay.TangemPayAnalyticsEvents
@ -127,7 +128,10 @@ internal class TangemPayOnboardingModel @Inject constructor(
val shouldExcludePaeraCustomers = params is TangemPayOnboardingComponent.Params.FromBannerInSettings
modelScope.launch {
val eligibleWalletsIds = eligibilityManager
.getEligibleWallets(shouldExcludePaeraCustomers = shouldExcludePaeraCustomers)
.getEligibleWallets(
shouldExcludePaeraCustomers = shouldExcludePaeraCustomers,
entryPoint = params.toEntryPointOrNull(),
)
.map { it.walletId }
if (eligibleWalletsIds.isEmpty()) {
back()
@ -204,4 +208,13 @@ internal class TangemPayOnboardingModel @Inject constructor(
override fun onWalletSelectorDismiss() {
bottomSheetNavigation.dismiss()
}
private fun TangemPayOnboardingComponent.Params.toEntryPointOrNull() = when (this) {
is TangemPayOnboardingComponent.Params.FromBannerInSettings -> TangemPayEntryPoint.DETAILS
is TangemPayOnboardingComponent.Params.FromBannerOnMain -> TangemPayEntryPoint.BANNER
is TangemPayOnboardingComponent.Params.Deeplink,
is TangemPayOnboardingComponent.Params.ContinueOnboarding,
-> null
}
}