mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Avoid race and duplication conditions between local and remote notifications (#848)
* added timestamp control of the local notification * improved the code, and implemented the solution, just needs some testing * sdk bump * UserPreference init with initialValue instead of defaultValue * pr suggestions * changelog * notifications sliding sync view added
This commit is contained in:
@@ -75,6 +75,17 @@ extension UserPreference {
|
||||
convenience init<R: RawRepresentable>(key: R, defaultValue: T, storageType: StorageType) where R.RawValue == String {
|
||||
self.init(key: key.rawValue, defaultValue: defaultValue, storageType: storageType)
|
||||
}
|
||||
|
||||
/// Convenience initializer that also immediatelly stores the provided initialValue.
|
||||
///
|
||||
/// - 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
|
||||
/// - storageType: the storage type where the wrappedValue will be stored.
|
||||
convenience init<R: RawRepresentable>(key: R, initialValue: T, storageType: StorageType) where R.RawValue == String {
|
||||
self.init(key: key, defaultValue: initialValue, storageType: storageType)
|
||||
wrappedValue = initialValue
|
||||
}
|
||||
|
||||
convenience init(key: String, storageType: StorageType) where T: ExpressibleByNilLiteral {
|
||||
self.init(key: key, defaultValue: nil, storageType: storageType)
|
||||
|
||||
Reference in New Issue
Block a user