Skip to content

Commit

Permalink
Switch Deletion Alert for a Confirmation Dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
JPKribs committed Oct 20, 2024
1 parent 549bbb2 commit 821e3f6
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,18 @@ struct APIKeyView: View {
} message: {
Text(L10n.apiKeyCopiedMessage)
}
.alert(L10n.deleteAPIKey, isPresented: $showDeleteConfirmation, presenting: apiKeyToDelete) { _ in
Button(L10n.cancel, role: .cancel) {}
.confirmationDialog(
L10n.deleteAPIKey,
isPresented: $showDeleteConfirmation,
titleVisibility: .visible
) {
Button(L10n.delete, role: .destructive) {
if let key = apiKeyToDelete {
viewModel.send(.deleteAPIKey(key: key))
}
}
} message: { _ in
Button(L10n.cancel, role: .cancel) {}
} message: {
Text(L10n.confirmDeleteAPIKeyMessage)
}
.alert(L10n.createAPIKey, isPresented: $showCreateAPIAlert) {
Expand Down

0 comments on commit 821e3f6

Please sign in to comment.