Commit 9ef618e4 authored by Jose Blaya's avatar Jose Blaya
Browse files

Region, quick connect and favorite servers tiles are broken when selecting a server

parent e0c34bc1
......@@ -454,6 +454,10 @@ class DashboardViewController: AutolayoutViewController {
currentStatus = Client.providers.vpnProvider.vpnStatus
NotificationCenter.default.post(name: .PIAServerHasBeenUpdated,
object: self,
userInfo: nil)
switch currentStatus {
case .connected:
toggleConnection.isOn = true
......
......@@ -164,10 +164,6 @@ class RegionsViewController: AutolayoutViewController {
NotificationCenter.default.post(name: .PIAThemeDidChange,
object: self,
userInfo: nil)
NotificationCenter.default.post(name: .PIAServerHasBeenUpdated,
object: self,
userInfo: nil)
default:
break
}
......
......@@ -14,7 +14,7 @@ extension Server: CustomStringConvertible {
func name(forStatus status: VPNStatus) -> String {
switch status {
// case .connecting, .changingServer, .connected:
case .connecting, .connected:
case .connected:
guard !isAutomatic else {
let effectiveServer = Client.providers.vpnProvider.profileServer ?? Client.providers.serverProvider.targetServer
return "\(name) (\(effectiveServer.name))"
......
......@@ -30,6 +30,8 @@ extension Client.Preferences {
let vpn = Client.providers.vpnProvider
if (vpn.vpnStatus != .disconnected) {
vpn.reconnect(after: nil, nil)
} else {
vpn.connect(nil)
}
}
}
......
......@@ -95,9 +95,6 @@ class FavoriteServersTile: UIView, Tileable {
NotificationCenter.default.post(name: .PIAThemeDidChange,
object: self,
userInfo: nil)
NotificationCenter.default.post(name: .PIAServerHasBeenUpdated,
object: self,
userInfo: nil)
}
}
......
......@@ -94,9 +94,6 @@ class QuickConnectTile: UIView, Tileable {
NotificationCenter.default.post(name: .PIAThemeDidChange,
object: self,
userInfo: nil)
NotificationCenter.default.post(name: .PIAServerHasBeenUpdated,
object: self,
userInfo: nil)
}
}
......
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14460.20"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14490.49"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
......@@ -35,7 +35,10 @@
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="h3Z-eW-74s">
<rect key="frame" x="25" y="19" width="0.0" height="0.0"/>
<rect key="frame" x="25" y="19" width="0.0" height="20"/>
<constraints>
<constraint firstAttribute="height" constant="20" id="3kO-m6-0KE"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
......
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