mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Security and privacy part 1 (#3617)
* added the security and settings button in details * added content to the view * added enable encryption alert * updated preview tests and the UI * removed wrong plists committed by mistake * pr suggestions
This commit is contained in:
+54
@@ -0,0 +1,54 @@
|
||||
//
|
||||
// Copyright 2022-2024 New Vector Ltd.
|
||||
//
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
// Please see LICENSE in the repository root for full details.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
enum SecurityAndPrivacyScreenViewModelAction {
|
||||
case done
|
||||
}
|
||||
|
||||
struct SecurityAndPrivacyScreenViewState: BindableState {
|
||||
var bindings: SecurityAndPrivacyScreenViewStateBindings
|
||||
|
||||
var currentSettings: SecurityAndPrivacySettings
|
||||
|
||||
var hasChanges: Bool {
|
||||
currentSettings != bindings.desiredSettings
|
||||
}
|
||||
|
||||
init(accessType: SecurityAndPrivacyRoomAccessType,
|
||||
isEncryptionEnabled: Bool) {
|
||||
let settings = SecurityAndPrivacySettings(accessType: accessType, isEncryptionEnabled: isEncryptionEnabled)
|
||||
currentSettings = settings
|
||||
bindings = SecurityAndPrivacyScreenViewStateBindings(desiredSettings: settings)
|
||||
}
|
||||
}
|
||||
|
||||
struct SecurityAndPrivacyScreenViewStateBindings {
|
||||
var desiredSettings: SecurityAndPrivacySettings
|
||||
var alertInfo: AlertInfo<SecurityAndPrivacyAlertType>?
|
||||
}
|
||||
|
||||
struct SecurityAndPrivacySettings: Equatable {
|
||||
var accessType: SecurityAndPrivacyRoomAccessType
|
||||
var isEncryptionEnabled: Bool
|
||||
}
|
||||
|
||||
enum SecurityAndPrivacyRoomAccessType {
|
||||
case inviteOnly
|
||||
case askToJoin
|
||||
case anyone
|
||||
}
|
||||
|
||||
enum SecurityAndPrivacyAlertType {
|
||||
case enableEncryption
|
||||
}
|
||||
|
||||
enum SecurityAndPrivacyScreenViewAction {
|
||||
case save
|
||||
case tryUpdatingEncryption(Bool)
|
||||
}
|
||||
Reference in New Issue
Block a user