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
@@ -19,6 +19,7 @@ import type {
ExtensionQuery, ExtensionQuery,
ExtensionConfig, ExtensionConfig,
} from '../api/types.gen'; } from '../api/types.gen';
import { removeShims } from './settings_v2/extensions/utils';
// Define a local version that matches the structure of the imported one // Define a local version that matches the structure of the imported one
export type FixedExtensionEntry = ExtensionConfig & { export type FixedExtensionEntry = ExtensionConfig & {
@@ -118,6 +119,10 @@ export const ConfigProvider: React.FC<ConfigProviderProps> = ({ children }) => {
}; };
const addExtension = async (name: string, config: ExtensionConfig, enabled: boolean) => { 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 }; const query: ExtensionQuery = { name, config, enabled };
await apiAddExtension({ await apiAddExtension({
body: query, body: query,
@@ -96,6 +96,7 @@ export default function ExtensionModal({
if (isFormValid()) { if (isFormValid()) {
onSubmit(formData); onSubmit(formData);
} }
onClose();
}; };
// Create footer buttons based on current state // Create footer buttons based on current state