aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/ui/editdialog.go
diff options
context:
space:
mode:
Diffstat (limited to 'ui/editdialog.go')
-rw-r--r--ui/editdialog.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/ui/editdialog.go b/ui/editdialog.go
index ac441f32..ba868893 100644
--- a/ui/editdialog.go
+++ b/ui/editdialog.go
@@ -257,13 +257,14 @@ func (dlg *EditDialog) onSaveButtonClicked() {
return
}
- names, err := conf.ListConfigNames()
+ existingTunnelList, err := service.IPCClientTunnels()
if err != nil {
walk.MsgBox(dlg, "Unable to list existing tunnels", err.Error(), walk.MsgBoxIconError)
return
}
- for _, name := range names {
- if strings.ToLower(name) == strings.ToLower(newName) {
+ newNameLower := strings.ToLower(newName)
+ for _, tunnel := range existingTunnelList {
+ if strings.ToLower(tunnel.Name) == newNameLower {
walk.MsgBox(dlg, "Tunnel already exists", fmt.Sprintf("Another tunnel already exists with the name ā€˜%sā€™.", newName), walk.MsgBoxIconWarning)
return
}