mirror of
https://github.com/element-hq/element-android
synced 2024-11-23 18:05:36 +03:00
Analytics: ViewEvent sent before the View is ready.
This commit is contained in:
parent
d0b62738e1
commit
eba5aa94ce
3 changed files with 11 additions and 3 deletions
|
@ -271,6 +271,7 @@ class HomeActivity :
|
|||
if (isFirstCreation()) {
|
||||
handleIntent(intent)
|
||||
}
|
||||
homeActivityViewModel.handle(HomeActivityViewActions.ViewStarted)
|
||||
}
|
||||
|
||||
private fun handleShowAnalyticsOptIn() {
|
||||
|
|
|
@ -18,6 +18,7 @@ package im.vector.app.features.home
|
|||
|
||||
import im.vector.app.core.platform.VectorViewModelAction
|
||||
|
||||
sealed class HomeActivityViewActions : VectorViewModelAction {
|
||||
object PushPromptHasBeenReviewed : HomeActivityViewActions()
|
||||
sealed interface HomeActivityViewActions : VectorViewModelAction {
|
||||
object ViewStarted : HomeActivityViewActions
|
||||
object PushPromptHasBeenReviewed : HomeActivityViewActions
|
||||
}
|
||||
|
|
|
@ -72,10 +72,13 @@ class HomeActivityViewModel @AssistedInject constructor(
|
|||
|
||||
companion object : MavericksViewModelFactory<HomeActivityViewModel, HomeActivityViewState> by hiltMavericksViewModelFactory()
|
||||
|
||||
private var isInitialized = false
|
||||
private var checkBootstrap = false
|
||||
private var onceTrusted = false
|
||||
|
||||
init {
|
||||
private fun initialize() {
|
||||
if (isInitialized) return
|
||||
isInitialized = true
|
||||
cleanupFiles()
|
||||
observeInitialSync()
|
||||
checkSessionPushIsOn()
|
||||
|
@ -257,6 +260,9 @@ class HomeActivityViewModel @AssistedInject constructor(
|
|||
HomeActivityViewActions.PushPromptHasBeenReviewed -> {
|
||||
vectorPreferences.setDidAskUserToEnableSessionPush()
|
||||
}
|
||||
HomeActivityViewActions.ViewStarted -> {
|
||||
initialize()
|
||||
}
|
||||
}.exhaustive
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue