Commit 94333bae authored by Jose Blaya's avatar Jose Blaya
Browse files

Merge branch '300-piax-update-automatic-server-flag' into 'release/3.0.0'

Resolve "PIAX. Update Automatic Server flag"

See merge request ios/vpn-ios!409
parents b9be3929 ca3197b5
......@@ -156,14 +156,17 @@ extension Theme {
Asset.Piax.Regions.noResultsLight.image
}
public func mapImageByServerName(_ serverName: String) -> String {
public func mapImageByServerName(_ serverName: String, andTargetServer targetServer: String? = nil) -> String {
let prefix = palette.appearance == .dark ? "Dark-Map-" : "Light-Map-"
if serverName != L10n.Global.automatic {
return prefix + serverName
} else {
return prefix + "Spain"
if let targetServer = targetServer {
return prefix + targetServer
} else {
return prefix + "Spain"
}
}
}
public func dragDropImage() -> UIImage {
......
......@@ -57,9 +57,10 @@ class RegionTile: UIView, Tileable {
@objc private func updateServer() {
let effectiveServer = Client.preferences.displayedServer
let targetServer = Client.providers.serverProvider.targetServer
let vpn = Client.providers.vpnProvider
self.serverName.text = effectiveServer.name(forStatus: vpn.vpnStatus)
self.mapImageView.image = UIImage(named: Theme.current.mapImageByServerName(effectiveServer.name))
self.mapImageView.image = UIImage(named: Theme.current.mapImageByServerName(effectiveServer.name, andTargetServer: targetServer.name))
}
@objc private func viewShouldRestyle() {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment