(event: KeyboardEvent)
| 83 | // Adds a keyboard shortcut to toggle the sidebar. |
| 84 | React.useEffect(() => { |
| 85 | const handleKeyDown = (event: KeyboardEvent) => { |
| 86 | if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) { |
| 87 | event.preventDefault(); |
| 88 | toggleSidebar(); |
| 89 | } |
| 90 | }; |
| 91 | |
| 92 | window.addEventListener("keydown", handleKeyDown); |
| 93 | return () => window.removeEventListener("keydown", handleKeyDown); |
nothing calls this directly
no outgoing calls
no test coverage detected