Skip to content

Commit

Permalink
Fix delete entry on ipad fix #389
Browse files Browse the repository at this point in the history
  • Loading branch information
bourvill committed Aug 29, 2023
1 parent b498adb commit 0bb37d1
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions App/Features/Entry/EntryView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ struct EntryView: View {
.padding(.horizontal)
WebView(entry: entry)
}

.toolbar {
ToolbarItem(placement: toolbarPlacement) {
HStack {
Expand All @@ -47,25 +48,26 @@ struct EntryView: View {
.frame(width: 28, height: 28)
}).accessibilityLabel("Entry option")
}
.actionSheet(isPresented: $showDeleteConfirm) {
ActionSheet(
title: Text("Confirm delete?"),
buttons: [
.destructive(Text("Delete")) {
self.context.delete(entry)
dismiss()
},
.cancel(),
]
)
}
}

}
.sheet(isPresented: $showTag) {
TagListFor(tagsForEntry: TagsForEntryPublisher(entry: self.entry))
.environment(\.managedObjectContext, context)
}
#if os(iOS)
.actionSheet(isPresented: $showDeleteConfirm) {
ActionSheet(
title: Text("Confirm delete?"),
buttons: [
.destructive(Text("Delete")) {
self.context.delete(entry)
dismiss()
},
.cancel(),
]
)
}
.navigationBarTitleDisplayMode(.inline)
#endif
}
Expand Down

0 comments on commit 0bb37d1

Please sign in to comment.