From 1de2a0b3e3e340e83990a7526fbd1188e2c9b106 Mon Sep 17 00:00:00 2001 From: Mauro <34335419+Velin92@users.noreply.github.com> Date: Thu, 6 Jul 2023 11:45:38 +0200 Subject: [PATCH] Notification Encryption Sync is defaulted to true (#1265) * notification encryption sync is defaulted to true * more documentation --- ElementX/Sources/Application/AppSettings.swift | 2 +- ElementX/Sources/Other/UserPreference.swift | 4 +++- NSE/Sources/Other/NSESettings.swift | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ElementX/Sources/Application/AppSettings.swift b/ElementX/Sources/Application/AppSettings.swift index 9d767e1ed..e0e4ac37e 100644 --- a/ElementX/Sources/Application/AppSettings.swift +++ b/ElementX/Sources/Application/AppSettings.swift @@ -186,7 +186,7 @@ final class AppSettings { var pusherProfileTag: String? /// Tag describing if the app and the NSE should use the encryption sync - @UserPreference(key: SharedUserDefaultsKeys.isEncryptionSyncEnabled, defaultValue: false, storageType: .userDefaults(store)) + @UserPreference(key: SharedUserDefaultsKeys.isEncryptionSyncEnabled, defaultValue: true, storageType: .userDefaults(store)) var isEncryptionSyncEnabled // MARK: - Other diff --git a/ElementX/Sources/Other/UserPreference.swift b/ElementX/Sources/Other/UserPreference.swift index 0aae35339..f53bcaa9f 100644 --- a/ElementX/Sources/Other/UserPreference.swift +++ b/ElementX/Sources/Other/UserPreference.swift @@ -77,10 +77,12 @@ extension UserPreference { } /// Convenience initializer that also immediatelly stores the provided initialValue. + /// The initial value is stored every time the app is launched. + /// And will override any existing values. /// /// - Parameters: /// - key: the raw representable key used to store the value, needs conform also to String - /// - initialValue: the initial value that will be stored, the initialValue is also used as defaultValue + /// - initialValue: the initial value that will be stored when the app is launched, the initialValue is also used as defaultValue /// - storageType: the storage type where the wrappedValue will be stored. convenience init(key: R, initialValue: T, storageType: StorageType) where R.RawValue == String { self.init(key: key, defaultValue: initialValue, storageType: storageType) diff --git a/NSE/Sources/Other/NSESettings.swift b/NSE/Sources/Other/NSESettings.swift index e8a63e98c..e53f841cb 100644 --- a/NSE/Sources/Other/NSESettings.swift +++ b/NSE/Sources/Other/NSESettings.swift @@ -23,6 +23,6 @@ final class NSESettings { private static var store: UserDefaults! = UserDefaults(suiteName: suiteName) /// Tag describing if the app and the NSE should use the encryption sync - @UserPreference(key: SharedUserDefaultsKeys.isEncryptionSyncEnabled, defaultValue: false, storageType: .userDefaults(store)) + @UserPreference(key: SharedUserDefaultsKeys.isEncryptionSyncEnabled, defaultValue: true, storageType: .userDefaults(store)) var isEncryptionSyncEnabled }