mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
apply delete label alert on macOS
This commit is contained in:
parent
ae4f82ac5c
commit
ed70ceb2c4
1 changed files with 15 additions and 15 deletions
|
|
@ -17,21 +17,6 @@ struct LabelsView: View {
|
|||
#if os(iOS)
|
||||
Form {
|
||||
innerBody
|
||||
.alert("Are you sure you want to delete this label?", isPresented: $showDeleteConfirmation) {
|
||||
Button("Delete Label", role: .destructive) {
|
||||
if let label = labelToRemove {
|
||||
withAnimation {
|
||||
viewModel.deleteLabel(
|
||||
dataService: dataService,
|
||||
labelID: label.unwrappedID,
|
||||
name: label.unwrappedName
|
||||
)
|
||||
}
|
||||
}
|
||||
self.labelToRemove = nil
|
||||
}
|
||||
Button("Cancel", role: .cancel) { self.labelToRemove = nil }
|
||||
}
|
||||
}
|
||||
#elseif os(macOS)
|
||||
List {
|
||||
|
|
@ -39,6 +24,21 @@ struct LabelsView: View {
|
|||
}
|
||||
#endif
|
||||
}
|
||||
.alert("Are you sure you want to delete this label?", isPresented: $showDeleteConfirmation) {
|
||||
Button("Delete Label", role: .destructive) {
|
||||
if let label = labelToRemove {
|
||||
withAnimation {
|
||||
viewModel.deleteLabel(
|
||||
dataService: dataService,
|
||||
labelID: label.unwrappedID,
|
||||
name: label.unwrappedName
|
||||
)
|
||||
}
|
||||
}
|
||||
self.labelToRemove = nil
|
||||
}
|
||||
Button("Cancel", role: .cancel) { self.labelToRemove = nil }
|
||||
}
|
||||
.sheet(isPresented: $viewModel.showCreateLabelModal) {
|
||||
CreateLabelView(viewModel: viewModel)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue