From c72f7056b3487844f724312ef4abb7a2624b6cb6 Mon Sep 17 00:00:00 2001 From: Roopesh Chander Date: Sat, 5 Jan 2019 19:18:36 +0530 Subject: [PATCH] macOS: On adding the first tunnel, select it Signed-off-by: Roopesh Chander --- .../macOS/ViewController/TunnelsListTableViewController.swift | 3 +++ 1 file changed, 3 insertions(+) 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) {