fix errors

This commit is contained in:
Christine Betts
2026-03-10 10:03:39 -04:00
parent cecb1e6ded
commit f34821c79b
2 changed files with 10 additions and 5 deletions

View File

@@ -8,7 +8,8 @@ import type React from 'react';
import { Box, Text } from 'ink'; import { Box, Text } from 'ink';
import type { RegistryExtension } from '../../../config/extensionRegistryClient.js'; import type { RegistryExtension } from '../../../config/extensionRegistryClient.js';
import { useKeypress } from '../../hooks/useKeypress.js'; import { useKeypress } from '../../hooks/useKeypress.js';
import { keyMatchers, Command } from '../../keyMatchers.js'; import { Command } from '../../key/keyMatchers.js';
import { useKeyMatchers } from '../../hooks/useKeyMatchers.js';
import { theme } from '../../semantic-colors.js'; import { theme } from '../../semantic-colors.js';
export interface ExtensionDetailsProps { export interface ExtensionDetailsProps {
@@ -28,6 +29,7 @@ export function ExtensionDetails({
onInstall, onInstall,
isInstalled, isInstalled,
}: ExtensionDetailsProps): React.JSX.Element { }: ExtensionDetailsProps): React.JSX.Element {
const keyMatchers = useKeyMatchers();
const [consentRequest, setConsentRequest] = useState<{ const [consentRequest, setConsentRequest] = useState<{
prompt: string; prompt: string;
resolve: (value: boolean) => void; resolve: (value: boolean) => void;
@@ -57,9 +59,12 @@ export function ExtensionDetails({
} }
if (keyMatchers[Command.RETURN](key) && !isInstalled && !isInstalling) { if (keyMatchers[Command.RETURN](key) && !isInstalled && !isInstalling) {
setIsInstalling(true); setIsInstalling(true);
onInstall((prompt: string) => new Promise((resolve) => { onInstall(
setConsentRequest({ prompt, resolve }); (prompt: string) =>
})); new Promise((resolve) => {
setConsentRequest({ prompt, resolve });
}),
);
return true; return true;
} }
return false; return false;

View File

@@ -25,7 +25,7 @@ import { useRegistrySearch } from '../../hooks/useRegistrySearch.js';
import { useUIState } from '../../contexts/UIStateContext.js'; import { useUIState } from '../../contexts/UIStateContext.js';
import { ExtensionDetails } from './ExtensionDetails.js'; import { ExtensionDetails } from './ExtensionDetails.js';
interface ExtensionRegistryViewProps { export interface ExtensionRegistryViewProps {
onSelect?: ( onSelect?: (
extension: RegistryExtension, extension: RegistryExtension,
requestConsentOverride?: (consent: string) => Promise<boolean>, requestConsentOverride?: (consent: string) => Promise<boolean>,