Remove FeatureFlag.NotificationSettings and FeatureFlag.PinUnlock
This commit is contained in:
parent
7fb70fabed
commit
82c86a2b4d
12 changed files with 16 additions and 77 deletions
|
|
@ -23,8 +23,6 @@ import io.element.android.features.rageshake.api.RageshakeFeatureAvailability
|
|||
import io.element.android.libraries.architecture.Presenter
|
||||
import io.element.android.libraries.designsystem.utils.snackbar.SnackbarDispatcher
|
||||
import io.element.android.libraries.designsystem.utils.snackbar.collectSnackbarMessageAsState
|
||||
import io.element.android.libraries.featureflag.api.FeatureFlagService
|
||||
import io.element.android.libraries.featureflag.api.FeatureFlags
|
||||
import io.element.android.libraries.indicator.api.IndicatorService
|
||||
import io.element.android.libraries.matrix.api.MatrixClient
|
||||
import io.element.android.libraries.matrix.api.oidc.AccountManagementAction
|
||||
|
|
@ -42,7 +40,6 @@ class PreferencesRootPresenter @Inject constructor(
|
|||
private val analyticsService: AnalyticsService,
|
||||
private val versionFormatter: VersionFormatter,
|
||||
private val snackbarDispatcher: SnackbarDispatcher,
|
||||
private val featureFlagService: FeatureFlagService,
|
||||
private val indicatorService: IndicatorService,
|
||||
private val directLogoutPresenter: Presenter<DirectLogoutState>,
|
||||
private val showDeveloperSettingsProvider: ShowDeveloperSettingsProvider,
|
||||
|
|
@ -60,15 +57,6 @@ class PreferencesRootPresenter @Inject constructor(
|
|||
val snackbarMessage by snackbarDispatcher.collectSnackbarMessageAsState()
|
||||
val hasAnalyticsProviders = remember { analyticsService.getAvailableAnalyticsProviders().isNotEmpty() }
|
||||
|
||||
val showNotificationSettings = remember { mutableStateOf(false) }
|
||||
LaunchedEffect(Unit) {
|
||||
showNotificationSettings.value = featureFlagService.isFeatureEnabled(FeatureFlags.NotificationSettings)
|
||||
}
|
||||
val showLockScreenSettings = remember { mutableStateOf(false) }
|
||||
LaunchedEffect(Unit) {
|
||||
showLockScreenSettings.value = featureFlagService.isFeatureEnabled(FeatureFlags.PinUnlock)
|
||||
}
|
||||
|
||||
// We should display the 'complete verification' option if the current session can be verified
|
||||
val canVerifyUserSession by sessionVerificationService.needsSessionVerification.collectAsState(false)
|
||||
|
||||
|
|
@ -122,8 +110,6 @@ class PreferencesRootPresenter @Inject constructor(
|
|||
canReportBug = canReportBug,
|
||||
showDeveloperSettings = showDeveloperSettings,
|
||||
canDeactivateAccount = canDeactivateAccount,
|
||||
showNotificationSettings = showNotificationSettings.value,
|
||||
showLockScreenSettings = showLockScreenSettings.value,
|
||||
showBlockedUsersItem = showBlockedUsersItem,
|
||||
directLogoutState = directLogoutState,
|
||||
snackbarMessage = snackbarMessage,
|
||||
|
|
|
|||
|
|
@ -24,8 +24,6 @@ data class PreferencesRootState(
|
|||
val showAnalyticsSettings: Boolean,
|
||||
val showDeveloperSettings: Boolean,
|
||||
val canDeactivateAccount: Boolean,
|
||||
val showLockScreenSettings: Boolean,
|
||||
val showNotificationSettings: Boolean,
|
||||
val showBlockedUsersItem: Boolean,
|
||||
val directLogoutState: DirectLogoutState,
|
||||
val snackbarMessage: SnackbarMessage?,
|
||||
|
|
|
|||
|
|
@ -27,8 +27,6 @@ fun aPreferencesRootState(
|
|||
showAnalyticsSettings = true,
|
||||
canReportBug = true,
|
||||
showDeveloperSettings = true,
|
||||
showNotificationSettings = true,
|
||||
showLockScreenSettings = true,
|
||||
showBlockedUsersItem = true,
|
||||
canDeactivateAccount = true,
|
||||
snackbarMessage = SnackbarMessage(CommonStrings.common_verification_complete),
|
||||
|
|
|
|||
|
|
@ -121,20 +121,16 @@ private fun ColumnScope.ManageAppSection(
|
|||
onOpenLockScreenSettings: () -> Unit,
|
||||
onSecureBackupClick: () -> Unit,
|
||||
) {
|
||||
if (state.showNotificationSettings) {
|
||||
ListItem(
|
||||
headlineContent = { Text(stringResource(id = R.string.screen_notification_settings_title)) },
|
||||
leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.Notifications())),
|
||||
onClick = onOpenNotificationSettings,
|
||||
)
|
||||
}
|
||||
if (state.showLockScreenSettings) {
|
||||
ListItem(
|
||||
headlineContent = { Text(stringResource(id = CommonStrings.common_screen_lock)) },
|
||||
leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.Lock())),
|
||||
onClick = onOpenLockScreenSettings,
|
||||
)
|
||||
}
|
||||
ListItem(
|
||||
headlineContent = { Text(stringResource(id = R.string.screen_notification_settings_title)) },
|
||||
leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.Notifications())),
|
||||
onClick = onOpenNotificationSettings,
|
||||
)
|
||||
ListItem(
|
||||
headlineContent = { Text(stringResource(id = CommonStrings.common_screen_lock)) },
|
||||
leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.Lock())),
|
||||
onClick = onOpenLockScreenSettings,
|
||||
)
|
||||
if (state.showSecureBackup) {
|
||||
ListItem(
|
||||
headlineContent = { Text(stringResource(id = CommonStrings.common_encryption)) },
|
||||
|
|
@ -143,9 +139,7 @@ private fun ColumnScope.ManageAppSection(
|
|||
onClick = onSecureBackupClick,
|
||||
)
|
||||
}
|
||||
if (state.showNotificationSettings || state.showLockScreenSettings || state.showSecureBackup) {
|
||||
HorizontalDivider()
|
||||
}
|
||||
HorizontalDivider()
|
||||
}
|
||||
|
||||
@Composable
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@ import io.element.android.features.preferences.impl.utils.ShowDeveloperSettingsP
|
|||
import io.element.android.features.rageshake.api.RageshakeFeatureAvailability
|
||||
import io.element.android.libraries.core.meta.BuildType
|
||||
import io.element.android.libraries.designsystem.utils.snackbar.SnackbarDispatcher
|
||||
import io.element.android.libraries.featureflag.test.FakeFeatureFlagService
|
||||
import io.element.android.libraries.indicator.api.IndicatorService
|
||||
import io.element.android.libraries.indicator.test.FakeIndicatorService
|
||||
import io.element.android.libraries.matrix.api.oidc.AccountManagementAction
|
||||
|
|
@ -77,8 +76,6 @@ class PreferencesRootPresenterTest {
|
|||
assertThat(loadedState.devicesManagementUrl).isNull()
|
||||
assertThat(loadedState.showAnalyticsSettings).isFalse()
|
||||
assertThat(loadedState.showDeveloperSettings).isTrue()
|
||||
assertThat(loadedState.showLockScreenSettings).isTrue()
|
||||
assertThat(loadedState.showNotificationSettings).isTrue()
|
||||
assertThat(loadedState.canDeactivateAccount).isTrue()
|
||||
assertThat(loadedState.canReportBug).isTrue()
|
||||
assertThat(loadedState.directLogoutState).isEqualTo(aDirectLogoutState())
|
||||
|
|
@ -194,7 +191,6 @@ class PreferencesRootPresenterTest {
|
|||
analyticsService = FakeAnalyticsService(),
|
||||
versionFormatter = FakeVersionFormatter(),
|
||||
snackbarDispatcher = SnackbarDispatcher(),
|
||||
featureFlagService = FakeFeatureFlagService(),
|
||||
indicatorService = indicatorService,
|
||||
directLogoutPresenter = { aDirectLogoutState() },
|
||||
showDeveloperSettingsProvider = showDeveloperSettingsProvider,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue