Updated on 2026-08-14
This commit is contained in:
parent
facd6bb2ca
commit
cf0bce7e61
16 changed files with 91 additions and 51 deletions
|
|
@ -127,9 +127,15 @@ internal class CreateWalletStartModel @Inject constructor(
|
|||
},
|
||||
)
|
||||
|
||||
init {
|
||||
analyticsEventHandler.send(
|
||||
event = IntroductionProcess.CreateWalletIntroScreenOpened(),
|
||||
)
|
||||
}
|
||||
|
||||
private fun onScanClick() {
|
||||
analyticsEventHandler.send(
|
||||
event = IntroductionProcess.ButtonScanCard(AnalyticsParam.ScreensSources.CreateNewWallet),
|
||||
event = IntroductionProcess.ButtonScanCard(AnalyticsParam.ScreensSources.CreateWalletIntro),
|
||||
)
|
||||
scanCard()
|
||||
}
|
||||
|
|
@ -137,7 +143,7 @@ internal class CreateWalletStartModel @Inject constructor(
|
|||
private fun onStartWithMobileWalletClick() {
|
||||
analyticsEventHandler.send(
|
||||
event = OnboardingAnalyticsEvent.Onboarding.ButtonMobileWallet(
|
||||
source = AnalyticsParam.ScreensSources.CreateNewWallet.value,
|
||||
source = AnalyticsParam.ScreensSources.CreateWalletIntro.value,
|
||||
),
|
||||
)
|
||||
if (!isHotWalletCreationSupported()) {
|
||||
|
|
@ -147,11 +153,11 @@ internal class CreateWalletStartModel @Inject constructor(
|
|||
return
|
||||
}
|
||||
|
||||
router.push(AppRoute.CreateMobileWallet(AnalyticsParam.ScreensSources.CreateNewWallet.value))
|
||||
router.push(AppRoute.CreateMobileWallet(AnalyticsParam.ScreensSources.CreateWalletIntro.value))
|
||||
}
|
||||
|
||||
private fun onBuyClick() {
|
||||
analyticsEventHandler.send(Basic.ButtonBuy(source = AnalyticsParam.ScreensSources.CreateNewWallet))
|
||||
analyticsEventHandler.send(Basic.ButtonBuy(source = AnalyticsParam.ScreensSources.CreateWalletIntro))
|
||||
modelScope.launch {
|
||||
generateBuyTangemCardLinkUseCase.invoke().let { urlOpener.openUrl(it) }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,9 @@ package com.tangem.features.details.model
|
|||
import com.tangem.common.routing.AppRoute
|
||||
import com.tangem.common.ui.userwallet.handle
|
||||
import com.tangem.common.ui.userwallet.state.UserWalletItemUM
|
||||
import com.tangem.core.analytics.api.AnalyticsEventHandler
|
||||
import com.tangem.core.analytics.models.AnalyticsParam
|
||||
import com.tangem.core.analytics.models.event.SignIn
|
||||
import com.tangem.core.decompose.di.ModelScoped
|
||||
import com.tangem.core.decompose.model.Model
|
||||
import com.tangem.core.decompose.navigation.Router
|
||||
|
|
@ -39,6 +42,7 @@ internal class UserWalletListModel @Inject constructor(
|
|||
private val userWalletSaver: UserWalletSaver,
|
||||
private val hotWalletFeatureToggles: HotWalletFeatureToggles,
|
||||
private val unlockWalletUseCase: UnlockWalletUseCase,
|
||||
private val analyticsEventHandler: AnalyticsEventHandler,
|
||||
) : Model() {
|
||||
|
||||
private val isWalletSavingInProgress: MutableStateFlow<Boolean> = MutableStateFlow(value = false)
|
||||
|
|
@ -87,6 +91,7 @@ internal class UserWalletListModel @Inject constructor(
|
|||
|
||||
private fun onAddNewWalletClick() {
|
||||
if (hotWalletFeatureToggles.isHotWalletEnabled) {
|
||||
analyticsEventHandler.send(SignIn.ButtonAddWallet(AnalyticsParam.ScreensSources.SignIn))
|
||||
router.push(AppRoute.CreateWalletSelection)
|
||||
} else {
|
||||
withProgress(isWalletSavingInProgress) {
|
||||
|
|
@ -105,6 +110,7 @@ internal class UserWalletListModel @Inject constructor(
|
|||
error.handle(
|
||||
onUserCancelled = {},
|
||||
onAlreadyUnlocked = { router.push(AppRoute.WalletSettings(userWalletId)) },
|
||||
analyticsEventHandler = analyticsEventHandler,
|
||||
showMessage = messageSender::send,
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
package com.tangem.features.hotwallet.accesscoderequest
|
||||
|
||||
import com.tangem.core.analytics.api.AnalyticsEventHandler
|
||||
import com.tangem.core.analytics.models.event.SignIn
|
||||
import com.tangem.core.decompose.di.ModelScoped
|
||||
import com.tangem.core.decompose.model.Model
|
||||
import com.tangem.core.ui.components.fields.PinTextColor
|
||||
|
|
@ -33,6 +35,7 @@ internal class HotAccessCodeRequestModel @Inject constructor(
|
|||
private val hotAccessCodeAttemptsRepository: HotWalletAccessCodeAttemptsRepository,
|
||||
private val userWalletsListRepository: UserWalletsListRepository,
|
||||
private val canUseBiometryUseCase: CanUseBiometryUseCase,
|
||||
private val analyticsEventHandler: AnalyticsEventHandler,
|
||||
) : Model() {
|
||||
|
||||
private val result = MutableStateFlow<HotWalletPasswordRequester.Result?>(null)
|
||||
|
|
@ -108,6 +111,7 @@ internal class HotAccessCodeRequestModel @Inject constructor(
|
|||
onAccessCodeChange = ::onAccessCodeChange,
|
||||
accessCode = "",
|
||||
useBiometricClick = {
|
||||
analyticsEventHandler.send(SignIn.ButtonBiometricSignIn())
|
||||
dismissState()
|
||||
result.value = HotWalletPasswordRequester.Result.UseBiometry
|
||||
},
|
||||
|
|
|
|||
|
|
@ -199,6 +199,7 @@ internal class WalletWarningsClickIntentsImplementor @Inject constructor(
|
|||
error.handle(
|
||||
onAlreadyUnlocked = {},
|
||||
onUserCancelled = {},
|
||||
analyticsEventHandler = analyticsEventHandler,
|
||||
showMessage = uiMessageSender::send,
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -58,14 +58,18 @@ internal class WelcomeModel @Inject constructor(
|
|||
modelScope.launch {
|
||||
val userWallets = userWalletsListRepository.userWalletsSync()
|
||||
val userWallet = userWallets.first { it.walletId == walletId }
|
||||
trackingContextProxy.proceedWithContext(userWallet) {
|
||||
val signInType = when {
|
||||
!userWallet.isLocked -> SignIn.ButtonWallet.SignInType.NoSecurity
|
||||
userWallet is UserWallet.Cold -> SignIn.ButtonWallet.SignInType.Card
|
||||
else -> SignIn.ButtonWallet.SignInType.AccessCode
|
||||
}
|
||||
analyticsEventHandler.send(SignIn.ButtonWallet(signInType))
|
||||
trackingContextProxy.addContext(userWallet)
|
||||
val signInType = when {
|
||||
!userWallet.isLocked -> SignIn.ButtonWallet.SignInType.NoSecurity
|
||||
userWallet is UserWallet.Cold -> SignIn.ButtonWallet.SignInType.Card
|
||||
else -> SignIn.ButtonWallet.SignInType.AccessCode
|
||||
}
|
||||
analyticsEventHandler.send(
|
||||
event = SignIn.ButtonWallet(
|
||||
signInType = signInType,
|
||||
walletsCount = userWallets.size,
|
||||
),
|
||||
)
|
||||
onUserWalletClick(userWallet)
|
||||
}
|
||||
},
|
||||
|
|
@ -210,6 +214,7 @@ internal class WelcomeModel @Inject constructor(
|
|||
router.replaceAll(AppRoute.Wallet)
|
||||
},
|
||||
onUserCancelled = { onUserCancelled() },
|
||||
analyticsEventHandler = analyticsEventHandler,
|
||||
showMessage = uiMessageSender::send,
|
||||
)
|
||||
}
|
||||
|
|
@ -226,13 +231,12 @@ internal class WelcomeModel @Inject constructor(
|
|||
|
||||
private suspend fun trackSignInEvent(userWallet: UserWallet, type: Basic.SignedIn.SignInType) {
|
||||
val walletsCount = userWalletsListRepository.userWalletsSync().size
|
||||
trackingContextProxy.proceedWithContext(userWallet) {
|
||||
analyticsEventHandler.send(
|
||||
event = Basic.SignedIn(
|
||||
signInType = type,
|
||||
walletsCount = walletsCount,
|
||||
),
|
||||
)
|
||||
}
|
||||
trackingContextProxy.addContext(userWallet)
|
||||
analyticsEventHandler.send(
|
||||
event = Basic.SignedIn(
|
||||
signInType = type,
|
||||
walletsCount = walletsCount,
|
||||
),
|
||||
)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue