update getting hosts that use keys to use new key system

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

No files matched your search

+2 -1
View File
@@ -200,10 +200,11 @@ class HostsManager: ObservableObject, @unchecked Sendable {
return result return result
} }
func getHostsKeysUsedOn(_ keys: [Keypair]) -> [Host] { func getHostsUsingKeys(_ keys: [Keypair]) -> [Host] {
var result: [Host] = [] var result: [Host] = []
for key in keys { for key in keys {
let hosts = hosts.filter({ let hosts = hosts.filter({
$0.privateKeyID == key.id ||
$0.publicKey == key.publicKey && $0.publicKey == key.publicKey &&
$0.privateKey == key.privateKey $0.privateKey == key.privateKey
}) })
+1 -1
View File
@@ -20,7 +20,7 @@ struct KeyDetailView: View {
VStack(alignment: .leading) { VStack(alignment: .leading) {
Text("Used on") Text("Used on")
.bold() .bold()
ForEach(hostsManager.getHostsKeysUsedOn([keypair])) { host in ForEach(hostsManager.getHostsUsingKeys([keypair])) { host in
HStack { HStack {
SymbolPreview(symbol: host.symbol, label: host.label) SymbolPreview(symbol: host.symbol, label: host.label)
.frame(width: 40, height: 40) .frame(width: 40, height: 40)
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.