From: Roopesh Chander Date: Sat, 5 Jan 2019 13:48:36 +0000 (+0530) Subject: macOS: On adding the first tunnel, select it X-Git-Tag: 0.0.20190207-1~143 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c72f7056b3487844f724312ef4abb7a2624b6cb6;p=thirdparty%2Fwireguard-apple.git macOS: On adding the first tunnel, select it Signed-off-by: Roopesh Chander --- diff --git a/WireGuard/WireGuard/UI/macOS/ViewController/TunnelsListTableViewController.swift b/WireGuard/WireGuard/UI/macOS/ViewController/TunnelsListTableViewController.swift index 0937453..7eee345 100644 --- a/WireGuard/WireGuard/UI/macOS/ViewController/TunnelsListTableViewController.swift +++ b/WireGuard/WireGuard/UI/macOS/ViewController/TunnelsListTableViewController.swift @@ -229,6 +229,9 @@ class TunnelsListTableViewController: NSViewController { extension TunnelsListTableViewController { func tunnelAdded(at index: Int) { tableView.insertRows(at: IndexSet(integer: index), withAnimation: .slideLeft) + if tunnelsManager.numberOfTunnels() == 1 { + selectTunnel(at: 0) + } } func tunnelModified(at index: Int) {