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

View File

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