Some main menu fixes

This commit is contained in:
James Magahern
2022-08-03 19:04:40 -07:00
parent 56ed848fe7
commit ace7917080
3 changed files with 33 additions and 1 deletions

View File

@@ -49,6 +49,15 @@ protocol ShortcutResponder: AnyObject {
optional func toggleDarkMode(_ sender: Any?)
}
fileprivate extension Array {
func removeNulls() -> Array {
self.filter { element in
guard let keyCommand = element as? UIKeyCommand else { return true }
return !keyCommand.isNull()
}
}
}
public class KeyboardShortcuts {
public enum Category: CaseIterable {
case application
@@ -121,7 +130,7 @@ public class KeyboardShortcuts {
action: #selector(ShortcutResponder.stop)
)
]),
]
].removeNulls()
case .go:
return [