(event: KeyboardEvent)
| 96 | // Adds a keyboard shortcut to toggle the sidebar. |
| 97 | React.useEffect(() => { |
| 98 | const handleKeyDown = (event: KeyboardEvent) => { |
| 99 | if ( |
| 100 | event.key === SIDEBAR_KEYBOARD_SHORTCUT && |
| 101 | (event.metaKey || event.ctrlKey) |
| 102 | ) { |
| 103 | event.preventDefault() |
| 104 | toggleSidebar() |
| 105 | } |
| 106 | } |
| 107 | |
| 108 | window.addEventListener("keydown", handleKeyDown) |
| 109 | return () => window.removeEventListener("keydown", handleKeyDown) |
nothing calls this directly
no outgoing calls
no test coverage detected