MCPcopy Create free account
hub / github.com/freecodexyz/free-code / handleKeyDown

Function handleKeyDown

src/commands/install-github-app/OAuthFlowStep.tsx:53–66  ·  view source on GitHub ↗
(e: KeyboardEvent)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

preventDefaultMethod · 0.80
onCancelFunction · 0.50

Tested by

no test coverage detected