(e: KeyboardEvent)
| 982 | |
| 983 | useEffect(() => { |
| 984 | const onKey = (e: KeyboardEvent): void => { |
| 985 | // Don't close Settings on Esc while a nested editor/modal is open — |
| 986 | // that would discard in-progress work (e.g. a template draft). Those |
| 987 | // modals handle Esc themselves (Vim normal mode, etc.). |
| 988 | if (e.key === 'Escape' && !templateEditor && !editingRemoteProfile) { |
| 989 | setSettingsOpen(false) |
| 990 | } |
| 991 | } |
| 992 | window.addEventListener('keydown', onKey) |
| 993 | return () => window.removeEventListener('keydown', onKey) |
| 994 | }, [setSettingsOpen, templateEditor, editingRemoteProfile]) |
nothing calls this directly
no test coverage detected