Revert to original configuration on tap

This commit is contained in:
Davide De Rosa 2018-10-22 11:31:46 +02:00
parent be17f57a5e
commit 6ee9f37880

View File

@ -122,7 +122,19 @@ class ConfigurationViewController: UIViewController, TableModelHost {
log.warning("Resetting with no original configuration set? Bad table model?")
return
}
// TODO
let originalConfiguration: TunnelKitProvider.Configuration
do {
(_, originalConfiguration) = try TunnelKitProvider.Configuration.parsed(from: url)
} catch let e {
log.warning("Could not parse original configuration: \(e)")
return
}
initialConfiguration = originalConfiguration
configuration = originalConfiguration.builder()
itemRefresh.isEnabled = true // allow for manual reconnection
tableView.reloadData()
delegate?.configurationShouldReinstall()
}
@IBAction private func refresh() {