ui: no shim in config (#1916)

This commit is contained in:
Lily Delalande
2025-03-31 11:27:18 -04:00
committed by GitHub
parent 06d5329930
commit 59da8f2349
2 changed files with 6 additions and 0 deletions

View File

@@ -19,6 +19,7 @@ import type {
ExtensionQuery,
ExtensionConfig,
} from '../api/types.gen';
import { removeShims } from './settings_v2/extensions/utils';
// Define a local version that matches the structure of the imported one
export type FixedExtensionEntry = ExtensionConfig & {
@@ -118,6 +119,10 @@ export const ConfigProvider: React.FC<ConfigProviderProps> = ({ children }) => {
};
const addExtension = async (name: string, config: ExtensionConfig, enabled: boolean) => {
// remove shims if present
if (config.type == 'stdio') {
config.cmd = removeShims(config.cmd);
}
const query: ExtensionQuery = { name, config, enabled };
await apiAddExtension({
body: query,

View File

@@ -96,6 +96,7 @@ export default function ExtensionModal({
if (isFormValid()) {
onSubmit(formData);
}
onClose();
};
// Create footer buttons based on current state