Implemented Clean Up keyboard shortcut. Issue #1915

This commit is contained in:
Maurice Parker 2020-03-15 18:15:52 -05:00
parent c08b6d1ccc
commit 07042b8a2a
5 changed files with 11 additions and 4 deletions

View File

@ -135,7 +135,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
func manualRefresh(errorHandler: @escaping (Error) -> ()) {
UIApplication.shared.connectedScenes.compactMap( { $0.delegate as? SceneDelegate } ).forEach {
$0.refreshInterface()
$0.cleanUp()
}
AccountManager.shared.refreshAll(errorHandler: errorHandler)
}

View File

@ -144,6 +144,9 @@ private extension KeyboardManager {
let markAllAsReadTitle = NSLocalizedString("Mark All as Read", comment: "Mark All as Read")
keys.append(KeyboardManager.createKeyCommand(title: markAllAsReadTitle, action: "markAllAsRead:", input: "k", modifiers: [.command]))
let cleanUp = NSLocalizedString("Clean Up", comment: "Clean Up")
keys.append(KeyboardManager.createKeyCommand(title: cleanUp, action: "cleanUp:", input: "h", modifiers: [.command, .shift]))
return keys
}

View File

@ -90,6 +90,10 @@ class RootSplitViewController: UISplitViewController {
coordinator.showAdd(.folder)
}
@objc func cleanUp(_ sender: Any?) {
coordinator.cleanUp()
}
@objc func refresh(_ sender: Any?) {
appDelegate.manualRefresh(errorHandler: ErrorHandler.present(self))
}

View File

@ -572,7 +572,7 @@ class SceneCoordinator: NSObject, UndoableCommandRunner, UnreadCountProvider {
fetchRequestQueue.cancelAllRequests()
}
func refreshInterface() {
func cleanUp() {
if isReadFeedsFiltered {
rebuildBackingStores()
}

View File

@ -84,8 +84,8 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
coordinator.suspend()
}
func refreshInterface() {
coordinator.refreshInterface()
func cleanUp() {
coordinator.cleanUp()
}
}