Remove FeatureFlag.NotificationSettings and FeatureFlag.PinUnlock

This commit is contained in:
Benoit Marty 2025-08-12 14:30:30 +02:00 committed by Benoit Marty
parent 7fb70fabed
commit 82c86a2b4d
12 changed files with 16 additions and 77 deletions

View file

@ -12,7 +12,6 @@ import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.derivedStateOf
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.produceState
import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope
@ -77,7 +76,6 @@ class RoomDetailsPresenter @Inject constructor(
override fun present(): RoomDetailsState {
val scope = rememberCoroutineScope()
val leaveRoomState = leaveRoomPresenter.present()
val canShowNotificationSettings = remember { mutableStateOf(false) }
val roomInfo by room.roomInfoFlow.collectAsState()
val isUserAdmin = room.isOwnUserAdmin()
val syncUpdateFlow = room.syncUpdateFlow.collectAsState()
@ -96,11 +94,8 @@ class RoomDetailsPresenter @Inject constructor(
}.collectAsState(false)
LaunchedEffect(Unit) {
canShowNotificationSettings.value = featureFlagService.isFeatureEnabled(FeatureFlags.NotificationSettings)
if (canShowNotificationSettings.value) {
room.updateRoomNotificationSettings()
observeNotificationSettings()
}
room.updateRoomNotificationSettings()
observeNotificationSettings()
}
val membersState by room.membersStateFlow.collectAsState()
@ -197,7 +192,6 @@ class RoomDetailsPresenter @Inject constructor(
isEncrypted = isEncrypted,
canInvite = canInvite,
canEdit = (canEditAvatar || canEditName || canEditTopic) && roomType == RoomDetailsType.Room,
canShowNotificationSettings = canShowNotificationSettings.value,
roomCallState = roomCallState,
roomType = roomType,
roomMemberDetailsState = roomMemberDetailsState,

View file

@ -32,7 +32,6 @@ data class RoomDetailsState(
val roomMemberDetailsState: UserProfileState?,
val canEdit: Boolean,
val canInvite: Boolean,
val canShowNotificationSettings: Boolean,
val roomCallState: RoomCallState,
val leaveRoomState: LeaveRoomState,
val roomNotificationSettings: RoomNotificationSettings?,

View file

@ -100,7 +100,6 @@ fun aRoomDetailsState(
isEncrypted: Boolean = true,
canInvite: Boolean = false,
canEdit: Boolean = false,
canShowNotificationSettings: Boolean = true,
roomCallState: RoomCallState = aStandByCallState(),
roomType: RoomDetailsType = RoomDetailsType.Room,
roomMemberDetailsState: UserProfileState? = null,
@ -132,7 +131,6 @@ fun aRoomDetailsState(
isEncrypted = isEncrypted,
canInvite = canInvite,
canEdit = canEdit,
canShowNotificationSettings = canShowNotificationSettings,
roomCallState = roomCallState,
roomType = roomType,
roomMemberDetailsState = roomMemberDetailsState,

View file

@ -185,7 +185,7 @@ fun RoomDetailsView(
}
PreferenceCategory {
if (state.canShowNotificationSettings && state.roomNotificationSettings != null) {
if (state.roomNotificationSettings != null) {
NotificationItem(
isDefaultMode = state.roomNotificationSettings.isDefault,
openRoomNotificationSettings = openRoomNotificationSettings
@ -337,8 +337,7 @@ private fun MainActionsSection(
.padding(horizontal = 16.dp),
horizontalArrangement = Arrangement.SpaceEvenly,
) {
val roomNotificationSettings = state.roomNotificationSettings
if (state.canShowNotificationSettings && roomNotificationSettings != null) {
state.roomNotificationSettings?.let { roomNotificationSettings ->
if (roomNotificationSettings.mode == RoomNotificationMode.MUTE) {
MainActionButton(
title = stringResource(CommonStrings.common_unmute),

View file

@ -79,7 +79,6 @@ class RoomDetailsPresenterTest {
analyticsService: AnalyticsService = FakeAnalyticsService(),
featureFlagService: FeatureFlagService = FakeFeatureFlagService(
mapOf(
FeatureFlags.NotificationSettings.key to true,
FeatureFlags.Knock.key to false,
)
),