mirror of
https://github.com/writeas/writefreely-swiftui-multiplatform.git
synced 2024-11-15 01:11:02 +00:00
Make cancel the default action in the delete-confirmation alert
This commit is contained in:
parent
c1be327694
commit
68fd0c91e7
@ -90,7 +90,10 @@ struct PostListFilteredView: View {
|
||||
Alert(
|
||||
title: Text("Delete Post?"),
|
||||
message: Text("This action cannot be undone."),
|
||||
primaryButton: .destructive(Text("Delete"), action: {
|
||||
primaryButton: .cancel() {
|
||||
model.postToDelete = nil
|
||||
},
|
||||
secondaryButton: .destructive(Text("Delete"), action: {
|
||||
if let postToDelete = model.postToDelete {
|
||||
model.selectedPost = nil
|
||||
DispatchQueue.main.async {
|
||||
@ -99,10 +102,7 @@ struct PostListFilteredView: View {
|
||||
}
|
||||
model.postToDelete = nil
|
||||
}
|
||||
}),
|
||||
secondaryButton: .cancel() {
|
||||
model.postToDelete = nil
|
||||
}
|
||||
})
|
||||
)
|
||||
}
|
||||
.onAppear(perform: {
|
||||
|
Loading…
Reference in New Issue
Block a user