Secure backup: create a feature flag (disabled)

This commit is contained in:
Benoit Marty 2023-10-31 20:49:48 +01:00 committed by Benoit Marty
parent ba004187f0
commit 5013ff061e
13 changed files with 64 additions and 6 deletions

View file

@ -39,6 +39,7 @@ import io.element.android.libraries.matrix.api.verification.SessionVerificationS
import io.element.android.services.analytics.api.AnalyticsService
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.launch
import kotlinx.coroutines.runBlocking
import javax.inject.Inject
class PreferencesRootPresenter @Inject constructor(
@ -78,6 +79,9 @@ class PreferencesRootPresenter @Inject constructor(
val showSecureBackupIndicator by indicatorService.showSettingChatBackupIndicator()
val secureStorageFlag by featureFlagService.isFeatureEnabledFlow(FeatureFlags.SecureStorage)
.collectAsState(initial = runBlocking { featureFlagService.isFeatureEnabled(FeatureFlags.SecureStorage) })
val accountManagementUrl: MutableState<String?> = remember {
mutableStateOf(null)
}
@ -94,7 +98,7 @@ class PreferencesRootPresenter @Inject constructor(
myUser = matrixUser.value,
version = versionFormatter.get(),
showCompleteVerification = showCompleteVerification,
showSecureBackup = !showCompleteVerification,
showSecureBackup = !showCompleteVerification && secureStorageFlag,
showSecureBackupBadge = showSecureBackupIndicator,
accountManagementUrl = accountManagementUrl.value,
devicesManagementUrl = devicesManagementUrl.value,

View file

@ -56,6 +56,7 @@ class PreferencesRootPresenterTest {
DefaultIndicatorService(
sessionVerificationService = sessionVerificationService,
encryptionService = FakeEncryptionService(),
featureFlagService = FakeFeatureFlagService(),
),
)
moleculeFlow(RecompositionMode.Immediate) {