|
|
@ -20,7 +20,6 @@ import androidx.compose.runtime.Composable |
|
|
|
import androidx.compose.runtime.LaunchedEffect |
|
|
|
import androidx.compose.runtime.LaunchedEffect |
|
|
|
import androidx.compose.runtime.MutableState |
|
|
|
import androidx.compose.runtime.MutableState |
|
|
|
import androidx.compose.runtime.collectAsState |
|
|
|
import androidx.compose.runtime.collectAsState |
|
|
|
import androidx.compose.runtime.derivedStateOf |
|
|
|
|
|
|
|
import androidx.compose.runtime.getValue |
|
|
|
import androidx.compose.runtime.getValue |
|
|
|
import androidx.compose.runtime.mutableStateOf |
|
|
|
import androidx.compose.runtime.mutableStateOf |
|
|
|
import androidx.compose.runtime.remember |
|
|
|
import androidx.compose.runtime.remember |
|
|
@ -34,7 +33,6 @@ import io.element.android.libraries.matrix.api.MatrixClient |
|
|
|
import io.element.android.libraries.matrix.api.user.MatrixUser |
|
|
|
import io.element.android.libraries.matrix.api.user.MatrixUser |
|
|
|
import io.element.android.libraries.matrix.api.user.getCurrentUser |
|
|
|
import io.element.android.libraries.matrix.api.user.getCurrentUser |
|
|
|
import io.element.android.libraries.matrix.api.verification.SessionVerificationService |
|
|
|
import io.element.android.libraries.matrix.api.verification.SessionVerificationService |
|
|
|
import io.element.android.libraries.matrix.api.verification.SessionVerifiedStatus |
|
|
|
|
|
|
|
import io.element.android.services.analytics.api.AnalyticsService |
|
|
|
import io.element.android.services.analytics.api.AnalyticsService |
|
|
|
import kotlinx.coroutines.CoroutineScope |
|
|
|
import kotlinx.coroutines.CoroutineScope |
|
|
|
import kotlinx.coroutines.launch |
|
|
|
import kotlinx.coroutines.launch |
|
|
@ -62,11 +60,8 @@ class PreferencesRootPresenter @Inject constructor( |
|
|
|
val snackbarMessage by snackbarDispatcher.collectSnackbarMessageAsState() |
|
|
|
val snackbarMessage by snackbarDispatcher.collectSnackbarMessageAsState() |
|
|
|
val hasAnalyticsProviders = remember { analyticsService.getAvailableAnalyticsProviders().isNotEmpty() } |
|
|
|
val hasAnalyticsProviders = remember { analyticsService.getAvailableAnalyticsProviders().isNotEmpty() } |
|
|
|
|
|
|
|
|
|
|
|
// Session verification status (unknown, not verified, verified) |
|
|
|
// We should display the 'complete verification' option if the current session can be verified |
|
|
|
val sessionVerifiedStatus by sessionVerificationService.sessionVerifiedStatus.collectAsState() |
|
|
|
val showCompleteVerification by sessionVerificationService.canVerifySessionFlow.collectAsState(false) |
|
|
|
val sessionIsNotVerified by remember { |
|
|
|
|
|
|
|
derivedStateOf { sessionVerifiedStatus == SessionVerifiedStatus.NotVerified } |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
val accountManagementUrl: MutableState<String?> = remember { |
|
|
|
val accountManagementUrl: MutableState<String?> = remember { |
|
|
|
mutableStateOf(null) |
|
|
|
mutableStateOf(null) |
|
|
@ -82,7 +77,7 @@ class PreferencesRootPresenter @Inject constructor( |
|
|
|
logoutState = logoutState, |
|
|
|
logoutState = logoutState, |
|
|
|
myUser = matrixUser.value, |
|
|
|
myUser = matrixUser.value, |
|
|
|
version = versionFormatter.get(), |
|
|
|
version = versionFormatter.get(), |
|
|
|
showCompleteVerification = sessionIsNotVerified, |
|
|
|
showCompleteVerification = showCompleteVerification, |
|
|
|
accountManagementUrl = accountManagementUrl.value, |
|
|
|
accountManagementUrl = accountManagementUrl.value, |
|
|
|
showAnalyticsSettings = hasAnalyticsProviders, |
|
|
|
showAnalyticsSettings = hasAnalyticsProviders, |
|
|
|
showDeveloperSettings = showDeveloperSettings, |
|
|
|
showDeveloperSettings = showDeveloperSettings, |
|
|
|