update getting hosts that use keys to use new key system

This commit is contained in:
neon443
2025-07-01 19:40:01 +01:00
parent 93d9636960
commit 0af64a4efd
2 changed files with 3 additions and 2 deletions

View File

@@ -200,10 +200,11 @@ class HostsManager: ObservableObject, @unchecked Sendable {
return result
}
func getHostsKeysUsedOn(_ keys: [Keypair]) -> [Host] {
func getHostsUsingKeys(_ keys: [Keypair]) -> [Host] {
var result: [Host] = []
for key in keys {
let hosts = hosts.filter({
$0.privateKeyID == key.id ||
$0.publicKey == key.publicKey &&
$0.privateKey == key.privateKey
})

View File

@@ -20,7 +20,7 @@ struct KeyDetailView: View {
VStack(alignment: .leading) {
Text("Used on")
.bold()
ForEach(hostsManager.getHostsKeysUsedOn([keypair])) { host in
ForEach(hostsManager.getHostsUsingKeys([keypair])) { host in
HStack {
SymbolPreview(symbol: host.symbol, label: host.label)
.frame(width: 40, height: 40)