(e: KeyboardEvent)
| 51 | const terminalSize = useTerminalSize(); |
| 52 | const textInputColumns = Math.max(50, terminalSize.columns - PASTE_HERE_MSG.length - 4); |
| 53 | function handleKeyDown(e: KeyboardEvent): void { |
| 54 | if (oauthStatus.state !== 'error') return; |
| 55 | e.preventDefault(); |
| 56 | if (e.key === 'return' && oauthStatus.toRetry) { |
| 57 | setPastedCode(''); |
| 58 | setCursorOffset(0); |
| 59 | setOAuthStatus({ |
| 60 | state: 'about_to_retry', |
| 61 | nextState: oauthStatus.toRetry |
| 62 | }); |
| 63 | } else { |
| 64 | onCancel(); |
| 65 | } |
| 66 | } |
| 67 | async function handleSubmitCode(value: string, url: string) { |
| 68 | try { |
| 69 | // Expecting format "authorizationCode#state" from the authorization callback URL |
nothing calls this directly
no test coverage detected