Don't reconnect if not necessary
This commit is contained in:
@@ -89,13 +89,15 @@ class MainViewController: UIViewController, SwitchesViewControllerDelegate {
|
|||||||
{
|
{
|
||||||
_headerView.xionLogoView.beginAnimating()
|
_headerView.xionLogoView.beginAnimating()
|
||||||
|
|
||||||
_updateConnectivityStatus(.Connecting)
|
if (!_server.connected) {
|
||||||
_server.connect { (error: NSError?) -> Void in
|
_updateConnectivityStatus(.Connecting)
|
||||||
if (error == nil) {
|
_server.connect { (error: NSError?) -> Void in
|
||||||
self._reloadDevices()
|
if (error == nil) {
|
||||||
self._startUpdatingDevices()
|
self._reloadDevices()
|
||||||
} else {
|
self._startUpdatingDevices()
|
||||||
self._updateConnectivityStatus(.Error)
|
} else {
|
||||||
|
self._updateConnectivityStatus(.Error)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user