mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-04 01:19:33 +00:00
fix(security&privacy): ensure edited settings are reset when options are hidden
This commit is contained in:
+14
-3
@@ -182,9 +182,20 @@ class SecurityAndPrivacyPresenter(
|
|||||||
eventSink = ::handleEvent,
|
eventSink = ::handleEvent,
|
||||||
)
|
)
|
||||||
|
|
||||||
// If the history visibility is not available for the current access, use the fallback.
|
// Revert changes that the user is not allowed to make anymore
|
||||||
LaunchedEffect(state.availableHistoryVisibilities) {
|
LaunchedEffect(permissions, state.editedSettings.roomAccess) {
|
||||||
if (editedSettings.historyVisibility !in state.availableHistoryVisibilities) {
|
if (!state.showRoomAccessSection) {
|
||||||
|
editedRoomAccess = savedSettings.roomAccess
|
||||||
|
}
|
||||||
|
if (!state.showEncryptionSection) {
|
||||||
|
editedIsEncrypted = savedSettings.isEncrypted
|
||||||
|
}
|
||||||
|
if (!state.showRoomVisibilitySections) {
|
||||||
|
editedVisibleInRoomDirectory = savedSettings.isVisibleInRoomDirectory
|
||||||
|
}
|
||||||
|
if (!state.showHistoryVisibilitySection) {
|
||||||
|
editedHistoryVisibility = savedSettings.historyVisibility
|
||||||
|
} else if (editedSettings.historyVisibility !in state.availableHistoryVisibilities) {
|
||||||
editedHistoryVisibility = editedSettings.historyVisibility.fallback()
|
editedHistoryVisibility = editedSettings.historyVisibility.fallback()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user