Update API [skip ci]

This commit is contained in:
Ilya Laktyushin
2020-08-21 13:56:34 +03:00
parent 28f76f75e4
commit 9b342df78d
11 changed files with 171 additions and 65 deletions

View File

@@ -3,6 +3,7 @@ import UIKit
import Display
import AsyncDisplayKit
import SwiftSignalKit
import Postbox
import TelegramPresentationData
import TelegramStringFormatting
import SearchBarNode
@@ -46,7 +47,7 @@ private func loadCountryCodes() -> [Country] {
let countryName = locale.localizedString(forIdentifier: countryId) ?? ""
if let countryCodeInt = Int(countryCode) {
result.append(Country(code: countryId, defaultName: countryName, name: countryName, countryCodes: [Country.CountryCode(code: countryCode, prefixes: [], patterns: [])]))
result.append(Country(code: countryId, name: countryName, localizedName: nil, countryCodes: [Country.CountryCode(code: countryCode, prefixes: [], patterns: [])], hidden: false))
}
if let maybeNameRange = maybeNameRange {
@@ -61,8 +62,8 @@ private func loadCountryCodes() -> [Country] {
private var countryCodes: [Country] = loadCountryCodes()
public func loadServerCountryCodes(network: Network) {
let _ = (getCountriesList(network: network, langCode: "")
public func loadServerCountryCodes(accountManager: AccountManager, network: Network) {
let _ = (getCountriesList(accountManager: accountManager, network: network, langCode: nil)
|> deliverOnMainQueue).start(next: { countries in
countryCodes = countries
})