Refactoring

This commit is contained in:
Ali
2022-05-29 03:00:17 +04:00
parent 0dd4f9d438
commit 47fb45e08f
29 changed files with 145 additions and 4097 deletions

View File

@@ -35,8 +35,8 @@ public struct ChatArchiveSettings: Equatable, Codable {
}
}
public func updateChatArchiveSettings(transaction: Transaction, _ f: @escaping (ChatArchiveSettings) -> ChatArchiveSettings) {
transaction.updatePreferencesEntry(key: ApplicationSpecificPreferencesKeys.chatArchiveSettings, { entry in
public func updateChatArchiveSettings(engine: TelegramEngine, _ f: @escaping (ChatArchiveSettings) -> ChatArchiveSettings) -> Signal<Never, NoError> {
return engine.preferences.update(id: ApplicationSpecificPreferencesKeys.chatArchiveSettings, { entry in
let currentSettings: ChatArchiveSettings
if let entry = entry?.get(ChatArchiveSettings.self) {
currentSettings = entry