()
| 13 | } |
| 14 | |
| 15 | export function AppShortcuts(): null { |
| 16 | useHotkeys( |
| 17 | 'mod+n', |
| 18 | (event) => { |
| 19 | if (shouldIgnoreAppShortcuts(event)) { |
| 20 | return |
| 21 | } |
| 22 | |
| 23 | void dispatchAppShortcutAction('new-chat', event) |
| 24 | }, |
| 25 | appShortcutOptions, |
| 26 | [] |
| 27 | ) |
| 28 | |
| 29 | useHotkeys( |
| 30 | 'mod+b', |
| 31 | (event) => { |
| 32 | if (shouldIgnoreAppShortcuts(event)) { |
| 33 | return |
| 34 | } |
| 35 | |
| 36 | void dispatchAppShortcutAction('toggle-sidebar', event) |
| 37 | }, |
| 38 | appShortcutOptions, |
| 39 | [] |
| 40 | ) |
| 41 | |
| 42 | useHotkeys( |
| 43 | 'mod+shift+f', |
| 44 | (event) => { |
| 45 | if (shouldIgnoreAppShortcuts(event)) { |
| 46 | return |
| 47 | } |
| 48 | |
| 49 | void dispatchAppShortcutAction('global-search', event) |
| 50 | }, |
| 51 | appShortcutOptions, |
| 52 | [] |
| 53 | ) |
| 54 | |
| 55 | useEffect(() => { |
| 56 | return window.api.shortcuts.onAction((action) => { |
| 57 | void dispatchForwardedShortcutAction(action) |
| 58 | }) |
| 59 | }, []) |
| 60 | |
| 61 | return null |
| 62 | } |
nothing calls this directly
no test coverage detected