Merge commit '7621e2f8dec938cf48181c8b10afc9b01f444e68' into beta

This commit is contained in:
Ilya Laktyushin
2025-12-06 02:17:48 +04:00
commit 8344b97e03
28070 changed files with 7995182 additions and 0 deletions
@@ -0,0 +1,36 @@
import Foundation
import TelegramCore
import SwiftSignalKit
public struct ExperimentalSettings: Codable, Equatable {
public static var defaultSettings: ExperimentalSettings {
return ExperimentalSettings()
}
public init() {
}
public init(from decoder: Decoder) throws {
}
public func encode(to encoder: Encoder) throws {
}
public static func ==(lhs: ExperimentalSettings, rhs: ExperimentalSettings) -> Bool {
return true
}
}
public func updateExperimentalSettingsInteractively(accountManager: AccountManager<TelegramAccountManagerTypes>, _ f: @escaping (ExperimentalSettings) -> ExperimentalSettings) -> Signal<Void, NoError> {
return accountManager.transaction { transaction -> Void in
transaction.updateSharedData(ApplicationSpecificSharedDataKeys.experimentalSettings, { entry in
let currentSettings: ExperimentalSettings
if let entry = entry?.get(ExperimentalSettings.self) {
currentSettings = entry
} else {
currentSettings = ExperimentalSettings.defaultSettings
}
return SharedPreferencesEntry(f(currentSettings))
})
}
}