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