Tunnels list: The Add and Settings buttons should be no-ops until the tunnels are loaded

Signed-off-by: Roopesh Chander <roop@roopc.net>
This commit is contained in:
Roopesh Chander 2018-11-03 00:25:35 +05:30
parent f6a29d9f50
commit 9df0064eac
1 changed files with 2 additions and 0 deletions

View File

@ -42,6 +42,7 @@ class TunnelsListTableViewController: UITableViewController {
}
@objc func addButtonTapped(sender: UIBarButtonItem!) {
if (self.tunnelsManager == nil) { return } // Do nothing until we've loaded the tunnels
let alert = UIAlertController(title: "", message: "Add a new WireGuard tunnel", preferredStyle: .actionSheet)
let importFileAction = UIAlertAction(title: "Create from file or archive", style: .default) { [weak self] (action) in
self?.presentViewControllerForFileImport()
@ -69,6 +70,7 @@ class TunnelsListTableViewController: UITableViewController {
}
@objc func settingsButtonTapped(sender: UIBarButtonItem!) {
if (self.tunnelsManager == nil) { return } // Do nothing until we've loaded the tunnels
let settingsVC = SettingsTableViewController(tunnelsManager: tunnelsManager)
let settingsNC = UINavigationController(rootViewController: settingsVC)
settingsNC.modalPresentationStyle = .formSheet