diff --git a/ShhShell/Views/Keys/KeyDetailView.swift b/ShhShell/Views/Keys/KeyDetailView.swift index 6631918..673914e 100644 --- a/ShhShell/Views/Keys/KeyDetailView.swift +++ b/ShhShell/Views/Keys/KeyDetailView.swift @@ -46,24 +46,26 @@ struct KeyDetailView: View { .buttonStyle(.plain) } } - Menu() { - ForEach(hostsManager.hostsNotUsing(key: keypair)) { host in - Button() { - hostsManager.set(keypair: keypair, onHost: host) - } label: { - host.symbol.image - .resizable().scaledToFit() - .foregroundStyle(.blue) - .frame(width: 20, height: 20) - Text(host.description) - .foregroundStyle(.blue) + if !hostsManager.hosts.isEmpty { + Menu() { + ForEach(hostsManager.hostsNotUsing(key: keypair)) { host in + Button() { + hostsManager.set(keypair: keypair, onHost: host) + } label: { + host.symbol.image + .resizable().scaledToFit() + .foregroundStyle(.blue) + .frame(width: 20, height: 20) + Text(host.description) + .foregroundStyle(.blue) + } } + } label: { + Image(systemName: "plus.circle.fill") + .symbolRenderingMode(.multicolor) + Text("Add") + .foregroundStyle(.green) } - } label: { - Image(systemName: "plus.circle.fill") - .symbolRenderingMode(.multicolor) - Text("Add") - .foregroundStyle(.green) } } diff --git a/SwiftTerm b/SwiftTerm index cdace6f..3ed94f8 160000 --- a/SwiftTerm +++ b/SwiftTerm @@ -1 +1 @@ -Subproject commit cdace6f038967c93f31a2bfe9107f96818c4ec17 +Subproject commit 3ed94f81172c3df013444f39668bd857f8dccfb6