mirror of
git://jb55.com/damus
synced 2024-09-30 08:50:42 +00:00
Add confirmation alert when clearing all bookmarks
Changelog-Added: Add confirmation alert when clearing all bookmarks Closes: #1016
This commit is contained in:
parent
e89c025d9d
commit
1394122542
@ -11,6 +11,7 @@ struct BookmarksView: View {
|
||||
let state: DamusState
|
||||
private let noneFilter: (NostrEvent) -> Bool = { _ in true }
|
||||
private let bookmarksTitle = NSLocalizedString("Bookmarks", comment: "Title of bookmarks view")
|
||||
@State private var clearAllAlert: Bool = false
|
||||
|
||||
@ObservedObject var manager: BookmarksManager
|
||||
|
||||
@ -45,10 +46,17 @@ struct BookmarksView: View {
|
||||
.toolbar {
|
||||
if !bookmarks.isEmpty {
|
||||
Button(NSLocalizedString("Clear All", comment: "Button for clearing bookmarks data.")) {
|
||||
manager.clearAll()
|
||||
clearAllAlert = true
|
||||
}
|
||||
}
|
||||
}
|
||||
.alert(NSLocalizedString("Are you sure you want to delete all of your bookmarks?", comment: "Alert for deleting all of the bookmarks."), isPresented: $clearAllAlert) {
|
||||
Button(NSLocalizedString("Cancel", comment: "Cancel deleting bookmarks."), role: .cancel) {
|
||||
}
|
||||
Button(NSLocalizedString("Continue", comment: "Continue with bookmarks.")) {
|
||||
manager.clearAll()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user