Updated on 2026-08-14
This commit is contained in:
parent
8c37dbd5b0
commit
9216890135
6 changed files with 25 additions and 5 deletions
|
|
@ -110,6 +110,7 @@ internal class WelcomeMiddleware {
|
|||
batch = scanResponse.card.batchId,
|
||||
signInType = signInType,
|
||||
walletsCount = userWalletsListManager.walletsCount.toString(),
|
||||
isImported = userWallet.isImported,
|
||||
hasBackup = scanResponse.card.backupStatus?.isActive,
|
||||
),
|
||||
)
|
||||
|
|
|
|||
|
|
@ -19,12 +19,14 @@ sealed class Basic(
|
|||
batch: String,
|
||||
signInType: SignInType,
|
||||
walletsCount: String,
|
||||
isImported: Boolean,
|
||||
hasBackup: Boolean?,
|
||||
) : Basic(
|
||||
event = "Signed in",
|
||||
params = buildMap {
|
||||
put(AnalyticsParam.CURRENCY, currency.value)
|
||||
put(AnalyticsParam.BATCH, batch)
|
||||
put("Wallet Type", if (isImported) "Seed Phrase" else "Seedless")
|
||||
put("Sign in type", signInType.name)
|
||||
put("Wallets Count", walletsCount)
|
||||
if (hasBackup != null) {
|
||||
|
|
|
|||
|
|
@ -199,13 +199,13 @@ internal class CreateWalletStartModel @Inject constructor(
|
|||
},
|
||||
ifRight = {
|
||||
setLoading(false)
|
||||
sendSignedInCardAnalyticsEvent(scanResponse)
|
||||
sendSignedInCardAnalyticsEvent(scanResponse = scanResponse, isImported = userWallet.isImported)
|
||||
appRouter.replaceAll(AppRoute.Wallet)
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
private suspend fun sendSignedInCardAnalyticsEvent(scanResponse: ScanResponse) {
|
||||
private suspend fun sendSignedInCardAnalyticsEvent(scanResponse: ScanResponse, isImported: Boolean) {
|
||||
val currency = ParamCardCurrencyConverter().convert(value = scanResponse.cardTypesResolver)
|
||||
if (currency != null) {
|
||||
analyticsEventHandler.send(
|
||||
|
|
@ -214,6 +214,7 @@ internal class CreateWalletStartModel @Inject constructor(
|
|||
batch = scanResponse.card.batchId,
|
||||
signInType = SignInType.Card,
|
||||
walletsCount = userWalletsListRepository.userWalletsSync().size.toString(),
|
||||
isImported = isImported,
|
||||
hasBackup = scanResponse.card.backupStatus?.isActive,
|
||||
),
|
||||
)
|
||||
|
|
|
|||
|
|
@ -202,13 +202,13 @@ internal class HomeModel @Inject constructor(
|
|||
ifRight = {
|
||||
reduxStateHolder.onUserWalletSelected(userWallet)
|
||||
setLoading(false)
|
||||
sendSignedInCardAnalyticsEvent(scanResponse)
|
||||
sendSignedInCardAnalyticsEvent(scanResponse, userWallet.isImported)
|
||||
appRouter.replaceAll(AppRoute.Wallet)
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
private suspend fun sendSignedInCardAnalyticsEvent(scanResponse: ScanResponse) {
|
||||
private suspend fun sendSignedInCardAnalyticsEvent(scanResponse: ScanResponse, isImported: Boolean) {
|
||||
val currency = ParamCardCurrencyConverter().convert(value = scanResponse.cardTypesResolver)
|
||||
if (currency != null) {
|
||||
analyticsEventHandler.send(
|
||||
|
|
@ -217,6 +217,7 @@ internal class HomeModel @Inject constructor(
|
|||
batch = scanResponse.card.batchId,
|
||||
signInType = SignInType.Card,
|
||||
walletsCount = getWalletsCount().toString(),
|
||||
isImported = isImported,
|
||||
hasBackup = scanResponse.card.backupStatus?.isActive,
|
||||
),
|
||||
)
|
||||
|
|
|
|||
|
|
@ -73,6 +73,13 @@ sealed class WalletScreenAnalyticsEvent {
|
|||
|
||||
data object ScreenOpened : MainScreen(event = "Screen opened")
|
||||
|
||||
class WalletSelected(val isImported: Boolean) : MainScreen(
|
||||
event = "Wallet Selected",
|
||||
params = mapOf(
|
||||
"Wallet Type" to if (isImported) "Seed Phrase" else "Seedless",
|
||||
),
|
||||
)
|
||||
|
||||
class EnableBiometrics(state: AnalyticsParam.OnOffState) : MainScreen(
|
||||
event = "Enable Biometric",
|
||||
params = mapOf("State" to state.value),
|
||||
|
|
|
|||
|
|
@ -29,6 +29,14 @@ internal class SelectedWalletAnalyticsSender @Inject constructor(
|
|||
* */
|
||||
private fun getEvent(userWallet: UserWallet): AnalyticsEvent? = when {
|
||||
userWallet.isLocked -> WalletScreenAnalyticsEvent.MainScreen.WalletUnlock
|
||||
else -> null
|
||||
|
||||
else -> WalletScreenAnalyticsEvent.MainScreen.WalletSelected(userWallet.isImported())
|
||||
}
|
||||
|
||||
private fun UserWallet.isImported(): Boolean {
|
||||
return when (this) {
|
||||
is UserWallet.Cold -> isImported
|
||||
is UserWallet.Hot -> true
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue