Share same build number in API

This commit is contained in:
Davide De Rosa 2022-04-19 14:36:44 +02:00
parent adbc086061
commit d2c4298f2d
3 changed files with 5 additions and 14 deletions

1
API Symbolic link
View File

@ -0,0 +1 @@
PassepartoutCore/Sources/PassepartoutServices/API/

View File

@ -171,9 +171,9 @@ public class ProviderManager: ObservableObject, RateLimited {
.eraseToAnyPublisher()
}
guard self.appBuild >= infrastructure.buildNumber else {
pp_log.error("Infrastructure requires app build >= \(infrastructure.buildNumber) (app is \(self.appBuild))")
return Fail(error: ProviderManagerError.outdatedBuild(self.appBuild, infrastructure.buildNumber))
guard self.appBuild >= infrastructure.build else {
pp_log.error("Infrastructure requires app build >= \(infrastructure.build) (app is \(self.appBuild))")
return Fail(error: ProviderManagerError.outdatedBuild(self.appBuild, infrastructure.build))
.eraseToAnyPublisher()
}

View File

@ -38,17 +38,7 @@ public struct WSProviderInfrastructure: Codable {
public let countryCode: String
}
public let build: [String: Int]
public var buildNumber: Int {
var num: Int?
#if os(iOS)
num = build["ios"]
#else
num = build["macos"]
#endif
return num ?? 0
}
public let build: Int
public let name: WSProviderName