ui: no shim in config (#1916)
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user