aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuard
diff options
context:
space:
mode:
authorRoopesh Chander <roop@roopc.net>2018-11-03 00:25:35 +0530
committerRoopesh Chander <roop@roopc.net>2018-11-03 10:25:47 +0530
commit9df0064eac8281eaca52da75586dfa6997a4d0ce (patch)
tree15c9c6a99b06dbaa7ce8efeb94981f24bcf5d831 /WireGuard
parentTunnel edit: Use layoutMarginsGuide instead of constants (diff)
downloadwireguard-apple-9df0064eac8281eaca52da75586dfa6997a4d0ce.tar.xz
wireguard-apple-9df0064eac8281eaca52da75586dfa6997a4d0ce.zip
Tunnels list: The Add and Settings buttons should be no-ops until the tunnels are loaded
Signed-off-by: Roopesh Chander <roop@roopc.net>
Diffstat (limited to 'WireGuard')
-rw-r--r--WireGuard/WireGuard/UI/iOS/TunnelsListTableViewController.swift2
1 files changed, 2 insertions, 0 deletions
diff --git a/WireGuard/WireGuard/UI/iOS/TunnelsListTableViewController.swift b/WireGuard/WireGuard/UI/iOS/TunnelsListTableViewController.swift
index 1ab7dd7..5ff9e8b 100644
--- a/WireGuard/WireGuard/UI/iOS/TunnelsListTableViewController.swift
+++ b/WireGuard/WireGuard/UI/iOS/TunnelsListTableViewController.swift
@@ -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