Some main menu fixes
This commit is contained in:
@@ -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 [
|
||||
|
||||
Reference in New Issue
Block a user