Moved updateSuperProperties from LoggedIn to Root controller
This commit is contained in:
@@ -23,13 +23,11 @@ import androidx.compose.runtime.derivedStateOf
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.remember
|
||||
import im.vector.app.features.analytics.plan.CryptoSessionStateChange
|
||||
import im.vector.app.features.analytics.plan.SuperProperties
|
||||
import im.vector.app.features.analytics.plan.UserProperties
|
||||
import io.element.android.features.networkmonitor.api.NetworkMonitor
|
||||
import io.element.android.features.networkmonitor.api.NetworkStatus
|
||||
import io.element.android.libraries.architecture.Presenter
|
||||
import io.element.android.libraries.matrix.api.MatrixClient
|
||||
import io.element.android.libraries.matrix.api.SdkMetadata
|
||||
import io.element.android.libraries.matrix.api.encryption.EncryptionService
|
||||
import io.element.android.libraries.matrix.api.encryption.RecoveryState
|
||||
import io.element.android.libraries.matrix.api.roomlist.RoomListService
|
||||
@@ -48,7 +46,6 @@ class LoggedInPresenter @Inject constructor(
|
||||
private val sessionVerificationService: SessionVerificationService,
|
||||
private val analyticsService: AnalyticsService,
|
||||
private val encryptionService: EncryptionService,
|
||||
private val sdkMetadata: SdkMetadata,
|
||||
) : Presenter<LoggedInState> {
|
||||
@Composable
|
||||
override fun present(): LoggedInState {
|
||||
@@ -95,16 +92,6 @@ class LoggedInPresenter @Inject constructor(
|
||||
reportCryptoStatusToAnalytics(verificationState, recoveryState)
|
||||
}
|
||||
|
||||
LaunchedEffect(Unit) {
|
||||
analyticsService.updateSuperProperties(
|
||||
SuperProperties(
|
||||
cryptoSDK = SuperProperties.CryptoSDK.Rust,
|
||||
appPlatform = SuperProperties.AppPlatform.EXA,
|
||||
cryptoSDKVersion = sdkMetadata.sdkGitSha,
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
return LoggedInState(
|
||||
showSyncSpinner = showSyncSpinner,
|
||||
)
|
||||
|
||||
@@ -17,11 +17,15 @@
|
||||
package io.element.android.appnav.root
|
||||
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.LaunchedEffect
|
||||
import androidx.compose.runtime.collectAsState
|
||||
import androidx.compose.runtime.getValue
|
||||
import im.vector.app.features.analytics.plan.SuperProperties
|
||||
import io.element.android.features.rageshake.api.crash.CrashDetectionPresenter
|
||||
import io.element.android.features.rageshake.api.detection.RageshakeDetectionPresenter
|
||||
import io.element.android.libraries.architecture.Presenter
|
||||
import io.element.android.libraries.matrix.api.SdkMetadata
|
||||
import io.element.android.services.analytics.api.AnalyticsService
|
||||
import io.element.android.services.apperror.api.AppErrorStateService
|
||||
import javax.inject.Inject
|
||||
|
||||
@@ -29,6 +33,8 @@ class RootPresenter @Inject constructor(
|
||||
private val crashDetectionPresenter: CrashDetectionPresenter,
|
||||
private val rageshakeDetectionPresenter: RageshakeDetectionPresenter,
|
||||
private val appErrorStateService: AppErrorStateService,
|
||||
private val analyticsService: AnalyticsService,
|
||||
private val sdkMetadata: SdkMetadata,
|
||||
) : Presenter<RootState> {
|
||||
@Composable
|
||||
override fun present(): RootState {
|
||||
@@ -36,6 +42,16 @@ class RootPresenter @Inject constructor(
|
||||
val crashDetectionState = crashDetectionPresenter.present()
|
||||
val appErrorState by appErrorStateService.appErrorStateFlow.collectAsState()
|
||||
|
||||
LaunchedEffect(Unit) {
|
||||
analyticsService.updateSuperProperties(
|
||||
SuperProperties(
|
||||
cryptoSDK = SuperProperties.CryptoSDK.Rust,
|
||||
appPlatform = SuperProperties.AppPlatform.EXA,
|
||||
cryptoSDKVersion = sdkMetadata.sdkGitSha,
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
return RootState(
|
||||
rageshakeDetectionState = rageshakeDetectionState,
|
||||
crashDetectionState = crashDetectionState,
|
||||
|
||||
Reference in New Issue
Block a user