fix: separate None from available keys in identity pickers

This commit is contained in:
Kaede Akino committed 2026-10-18 22:36:36 +08:00
1 parent 7a8fe3106a
commit 59021ecf4e
3 files changed
+9

No files matched your search

@@ -82,6 +82,9 @@ public struct IdentityFormSections: View {
if showsKey {
Picker(AppStrings.Vault.key.swiftUIKey, selection: $keyID) {
Text(AppStrings.Common.none).tag(SSHKeyRef.ID?.none)
if !keys.isEmpty {
Divider()
}
ForEach(keys) { key in
Text(key.label).tag(SSHKeyRef.ID?.some(key.id))
}
@@ -134,6 +134,9 @@ struct MobileHostEditor: View {
}
Picker(AppStrings.Vault.key.swiftUIKey, selection: $customIdentity.sshKeyID) {
Text(AppStrings.Common.none).tag(SSHKeyRef.ID?.none)
if !library.keys.isEmpty {
Divider()
}
ForEach(library.keys) { key in Text(key.label).tag(SSHKeyRef.ID?.some(key.id)) }
}
}
@@ -246,6 +246,9 @@ struct HostEditorView: View {
.disabled(!customIdentity.sshPasswordIsEditable)
Picker(AppStrings.Vault.key.swiftUIKey, selection: $customIdentity.sshKeyID) {
Text(AppStrings.Common.none).tag(SSHKeyRef.ID?.none)
if !app.hostLibrary.keys.isEmpty {
Divider()
}
ForEach(app.hostLibrary.keys) { key in
Text(key.label).tag(SSHKeyRef.ID?.some(key.id))
}