fix crash when opensshpubkey cant be made

fix expand button not enabled sometimes
This commit is contained in:
neon443
2025-09-06 16:51:33 +01:00
parent 97ef265cd2
commit d1408ee5d5
2 changed files with 7 additions and 2 deletions

View File

@@ -52,7 +52,12 @@ struct Keypair: KeypairProtocol {
}
var base64Pubkey: String {
String(openSshPubkey.split(separator: " ")[1])
let split = openSshPubkey.split(separator: " ")
if split.count >= 2 {
return String(split[1])
} else {
return "Error creating OpenSSH Publickey"
}
}
var base64Privkey: String {

View File

@@ -98,7 +98,7 @@ struct RecentsView: View {
.foregroundStyle(hostsManager.tint)
}
.buttonStyle(.plain)
.disabled(historyLimit != 0)
.disabled(historyLimit >= hostsManager.history.count)
.padding(.trailing, 10)
Button {