1
0
Fork 0
mirror of https://github.com/anyproto/anytype-kotlin.git synced 2025-06-08 05:47:05 +09:00

DROID-1648 Onboarding | Analytics | Fix order of onboarding steps (#292)

This commit is contained in:
Evgenii Kozlov 2023-08-15 21:12:30 +02:00 committed by GitHub
parent 454e586222
commit f91807f89a
Signed by: github
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 14 deletions

View file

@ -36,6 +36,9 @@ class AmplitudeTracker(
analytics
.observeEvents()
.collect { event ->
if (BuildConfig.DEBUG) {
Timber.d("Analytics Amplitude(event = $event)")
}
if (BuildConfig.SEND_EVENTS && event is EventAnalytics.Anytype) {
val props = event.props.getEventProperties(
startTime = event.duration?.start,
@ -43,9 +46,6 @@ class AmplitudeTracker(
renderTime = event.duration?.render
)
tracker.logEvent(event.name, props)
if (BuildConfig.DEBUG) {
Timber.d("Analytics Amplitude(event = $event)")
}
}
}
}

View file

@ -538,7 +538,6 @@ class OnboardingFragment : Fragment() {
navController.navigate(
route = OnboardingNavigation.createSoulAnim
)
vm.sendAnalyticsOnboardingScreen()
}
}
}

View file

@ -35,6 +35,9 @@ class OnboardingSoulCreationViewModel @Inject constructor(
val config = configStorage.getOrNull()
if (config != null) {
viewModelScope.launch {
sendAnalyticsOnboardingScreenEvent(analytics,
EventsDictionary.ScreenOnboardingStep.SOUL_CREATING
)
setObjectDetails.async(
SetObjectDetails.Params(
ctx = config.profile, details = mapOf(Relations.NAME to name)
@ -59,6 +62,10 @@ class OnboardingSoulCreationViewModel @Inject constructor(
val config = configStorage.getOrNull()
if (config != null) {
viewModelScope.launch {
sendAnalyticsOnboardingScreenEvent(
analytics = analytics,
step = EventsDictionary.ScreenOnboardingStep.SPACE_CREATING
)
setObjectDetails.async(
SetObjectDetails.Params(
ctx = config.workspace,
@ -69,10 +76,6 @@ class OnboardingSoulCreationViewModel @Inject constructor(
Timber.e(it, "Error while updating object details")
},
onSuccess = {
sendAnalyticsOnboardingScreenEvent(
analytics = analytics,
step = EventsDictionary.ScreenOnboardingStep.SPACE_CREATING
)
_navigationFlow.emit(Navigation.OpenSoulCreationAnim(name))
}
)
@ -88,12 +91,6 @@ class OnboardingSoulCreationViewModel @Inject constructor(
viewModelScope.launch { toasts.emit(msg) }
}
fun sendAnalyticsOnboardingScreen() {
viewModelScope.sendAnalyticsOnboardingScreenEvent(analytics,
EventsDictionary.ScreenOnboardingStep.SOUL_CREATING
)
}
sealed interface Navigation {
class OpenSoulCreationAnim(val name: String): Navigation
}