Rename Vault editor discard actions
This commit is contained in:
1 parent
144551566a
commit
e55f201ac7
6 files changed
+19
-9
No files matched your search
@@ -748,7 +748,7 @@ struct HostEditorView: View {
|
||||
.lineLimit(2)
|
||||
}
|
||||
Spacer()
|
||||
Button("Discard", action: closeTab)
|
||||
Button("Cancel", action: cancel)
|
||||
Button("Save") { saveAndClose() }
|
||||
.buttonStyle(.borderedProminent)
|
||||
.keyboardShortcut(.defaultAction)
|
||||
|
||||
@@ -525,7 +525,10 @@ private struct SoftwareKeyEditor: View {
|
||||
|
||||
var body: some View {
|
||||
VaultDetailScaffold(
|
||||
title: title, symbol: symbol, close: existing == nil ? close : cancelEditing,
|
||||
title: title, symbol: symbol,
|
||||
close: {
|
||||
if existing == nil { close() } else { cancelEditing() }
|
||||
},
|
||||
closeLabel: existing == nil ? "Close" : "Cancel"
|
||||
) {
|
||||
if isLoading {
|
||||
@@ -607,7 +610,9 @@ private struct SoftwareKeyEditor: View {
|
||||
}
|
||||
Spacer()
|
||||
if isWorking { ProgressView().controlSize(.small) }
|
||||
Button(existing == nil ? "Cancel" : "Discard", action: close)
|
||||
Button("Cancel") {
|
||||
if existing == nil { close() } else { cancelEditing() }
|
||||
}
|
||||
Button(existing == nil ? "Import" : "Save") {
|
||||
Task {
|
||||
guard await commitChanges() else { return }
|
||||
@@ -1302,7 +1307,7 @@ private struct SecureEnclaveKeyEditor: View {
|
||||
HStack(spacing: Metrics.Space.m) {
|
||||
Button("Delete", role: .destructive) { confirmsDeletion = true }
|
||||
Spacer()
|
||||
Button("Discard", action: close)
|
||||
Button("Cancel", action: cancelEditing)
|
||||
Button("Save", action: saveAndClose)
|
||||
.buttonStyle(.borderedProminent)
|
||||
.keyboardShortcut(.defaultAction)
|
||||
|
||||
@@ -102,7 +102,10 @@ struct NewIdentitySheet: View {
|
||||
var body: some View {
|
||||
VaultDetailScaffold(
|
||||
title: LocalizedStringKey(existing == nil ? configuration.newTitle : configuration.editTitle),
|
||||
symbol: "person.badge.key.fill", close: requestedClose == nil ? close : cancelEditing,
|
||||
symbol: "person.badge.key.fill",
|
||||
close: {
|
||||
if requestedClose == nil { close() } else { cancelEditing() }
|
||||
},
|
||||
closeLabel: requestedClose == nil ? "Back" : "Cancel",
|
||||
closeSymbol: requestedClose == nil ? "chevron.backward" : "xmark"
|
||||
) {
|
||||
@@ -157,7 +160,9 @@ struct NewIdentitySheet: View {
|
||||
Button("Delete", role: .destructive) { confirmsDeletion = true }
|
||||
}
|
||||
Spacer()
|
||||
Button("Discard", action: close)
|
||||
Button("Cancel") {
|
||||
if requestedClose == nil { close() } else { cancelEditing() }
|
||||
}
|
||||
Button("Save", action: saveAndClose)
|
||||
.buttonStyle(.borderedProminent)
|
||||
.keyboardShortcut(.defaultAction)
|
||||
|
||||
@@ -214,7 +214,7 @@ struct KnownHostEditorView: View {
|
||||
Button("Delete", role: .destructive) { confirmsDeletion = true }
|
||||
}
|
||||
Spacer()
|
||||
Button("Discard", action: window.closeVaultWork)
|
||||
Button("Cancel", action: cancelEditing)
|
||||
Button("Save", action: saveAndClose).buttonStyle(.borderedProminent)
|
||||
.keyboardShortcut(.defaultAction).disabled(!draft.isValid)
|
||||
}.padding(Metrics.Space.l)
|
||||
|
||||
@@ -263,7 +263,7 @@ struct PortForwardingDetailView: View {
|
||||
Button("Delete", role: .destructive) { confirmsDeletion = true }
|
||||
}
|
||||
Spacer()
|
||||
Button("Discard", action: window.closeVaultWork)
|
||||
Button("Cancel", action: cancelEditing)
|
||||
Button("Save", action: saveAndClose).buttonStyle(.borderedProminent)
|
||||
.keyboardShortcut(.defaultAction).disabled(!canSave)
|
||||
}.padding(Metrics.Space.l)
|
||||
|
||||
@@ -695,7 +695,7 @@ struct SnippetEditorSheet: View {
|
||||
Button("Delete", role: .destructive) { confirmsDeletion = true }
|
||||
}
|
||||
Spacer()
|
||||
Button("Discard", action: close)
|
||||
Button("Cancel", action: cancelEditing)
|
||||
Button("Save", action: saveAndClose)
|
||||
.buttonStyle(.borderedProminent)
|
||||
.keyboardShortcut(.defaultAction)
|
||||
|
||||
Reference in new issue
Block a user