mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
Merge branch 'master' into postbox-refactoring-1
This commit is contained in:
@@ -8,12 +8,12 @@ public func updateContentPrivacySettings(postbox: Postbox, _ f: @escaping (Conte
|
||||
return postbox.transaction { transaction -> Void in
|
||||
var updated: ContentPrivacySettings?
|
||||
transaction.updatePreferencesEntry(key: PreferencesKeys.contentPrivacySettings, { current in
|
||||
if let current = current as? ContentPrivacySettings {
|
||||
if let current = current?.get(ContentPrivacySettings.self) {
|
||||
updated = f(current)
|
||||
return updated
|
||||
return PreferencesEntry(updated)
|
||||
} else {
|
||||
updated = f(ContentPrivacySettings.defaultSettings)
|
||||
return updated
|
||||
return PreferencesEntry(updated)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user