Forgive a nil statusIndexPath

Also drop a few unused and potentially dangerous similar methods.

Fixes #36
This commit is contained in:
Davide De Rosa 2019-03-05 10:14:21 +01:00
parent c4495f6715
commit 4eeca4c63c
2 changed files with 11 additions and 19 deletions

View File

@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## 1.0.3 Beta 1323 (2019-03-06)
### Fixed
- Regression in profile activation. [#36](https://github.com/passepartoutvpn/passepartout-ios/issues/36)
## 1.0.2 (2019-03-04) ## 1.0.2 (2019-03-04)
### Fixed ### Fixed

View File

@ -482,18 +482,8 @@ extension ServiceViewController: UITableViewDataSource, UITableViewDelegate, Tog
return model.index(ofSection: .trusted) return model.index(ofSection: .trusted)
} }
private var serviceIndexPath: IndexPath { private var statusIndexPath: IndexPath? {
guard let ip = model.indexPath(row: .vpnService, section: .vpn) else { return model.indexPath(row: .connectionStatus, section: .vpn)
fatalError("Could not locate serviceIndexPath")
}
return ip
}
private var statusIndexPath: IndexPath {
guard let ip = model.indexPath(row: .connectionStatus, section: .vpn) else {
fatalError("Could not locate statusIndexPath")
}
return ip
} }
private var endpointIndexPath: IndexPath { private var endpointIndexPath: IndexPath {
@ -503,13 +493,6 @@ extension ServiceViewController: UITableViewDataSource, UITableViewDelegate, Tog
return ip return ip
} }
private var providerPresetIndexPath: IndexPath {
guard let ip = model.indexPath(row: .providerPreset, section: .configuration) else {
fatalError("Could not locate providerPresetIndexPath")
}
return ip
}
func numberOfSections(in tableView: UITableView) -> Int { func numberOfSections(in tableView: UITableView) -> Int {
return model.count return model.count
} }
@ -937,6 +920,9 @@ extension ServiceViewController: UITableViewDataSource, UITableViewDelegate, Tog
guard service.isActiveProfile(profile) else { guard service.isActiveProfile(profile) else {
return return
} }
guard let statusIndexPath = statusIndexPath else {
return
}
tableView.reloadRows(at: [statusIndexPath], with: .none) tableView.reloadRows(at: [statusIndexPath], with: .none)
} }