Change the Mark All As Read confirmation back to an Alert. Fixes #2968

This commit is contained in:
Maurice Parker
2021-04-03 11:02:15 -05:00
parent 1874e0c7d2
commit b69f936cb1
2 changed files with 5 additions and 29 deletions

View File

@@ -19,15 +19,7 @@ class MasterTimelineViewController: UITableViewController, UndoableCommandRunner
private var refreshProgressView: RefreshProgressView?
@IBOutlet weak var markAllAsReadButton: UIBarButtonItem! {
didSet {
if #available(iOS 14, *) {
markAllAsReadButton.primaryAction = nil
} else {
markAllAsReadButton.action = #selector(MasterTimelineViewController.markAllAsRead(_:))
}
}
}
@IBOutlet weak var markAllAsReadButton: UIBarButtonItem!
private var filterButton: UIBarButtonItem!
private var firstUnreadButton: UIBarButtonItem!
@@ -666,25 +658,6 @@ private extension MasterTimelineViewController {
setToolbarItems(items, animated: false)
}
}
if #available(iOS 14, *) {
let title = NSLocalizedString("Mark All as Read", comment: "Mark All as Read")
var markAsReadAction: UIAction!
if AppDefaults.shared.confirmMarkAllAsRead {
markAsReadAction = UIAction(title: title, image: AppAssets.markAllAsReadImage, discoverabilityTitle: "in \(self.title!)") { [weak self] action in
self?.coordinator.markAllAsReadInTimeline()
}
let settingsAction = UIAction(title: NSLocalizedString("Settings", comment: "Settings"), image: UIImage(systemName: "gear")!, discoverabilityTitle: NSLocalizedString("You can turn this confirmation off in Settings.", comment: "You can turn this confirmation off in Settings.")) { [weak self] action in
self?.coordinator.showSettings(scrollToArticlesSection: true)
}
markAllAsReadButton.menu = UIMenu(title: NSLocalizedString(title, comment: title), image: nil, identifier: nil, children: [settingsAction, markAsReadAction])
markAllAsReadButton.action = nil
} else {
markAllAsReadButton.action = #selector(MasterTimelineViewController.markAllAsRead(_:))
}
}
}
func updateTitleUnreadCount() {