mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 22:55:00 +00:00
Refactoring
This commit is contained in:
@@ -333,5 +333,26 @@ public extension TelegramEngine.EngineData.Item {
|
||||
return EngineContentSettings(appConfiguration: appConfiguration)
|
||||
}
|
||||
}
|
||||
|
||||
public struct LocalizationList: TelegramEngineDataItem, PostboxViewDataItem {
|
||||
public typealias Result = LocalizationListState
|
||||
|
||||
public init() {
|
||||
}
|
||||
|
||||
var key: PostboxViewKey {
|
||||
return .preferences(keys: Set([PreferencesKeys.localizationListState]))
|
||||
}
|
||||
|
||||
func extract(view: PostboxView) -> Result {
|
||||
guard let view = view as? PreferencesView else {
|
||||
preconditionFailure()
|
||||
}
|
||||
guard let localizationListState = view.values[PreferencesKeys.localizationListState]?.get(LocalizationListState.self) else {
|
||||
return LocalizationListState.defaultSettings
|
||||
}
|
||||
return localizationListState
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user