Fix: Recipe Extensions Not Loading in Desktop (#6777)
This commit is contained in:
@@ -81,12 +81,8 @@ export default function CreateEditRecipeModal({
|
||||
const [copied, setCopied] = useState(false);
|
||||
const [isSaving, setIsSaving] = useState(false);
|
||||
|
||||
// Initialize selected extensions for the recipe
|
||||
const [recipeExtensions] = useState<ExtensionConfig[]>(() => {
|
||||
if (recipe?.extensions) {
|
||||
return recipe.extensions;
|
||||
}
|
||||
return [];
|
||||
const [recipeExtensions] = useState<ExtensionConfig[] | undefined>(() => {
|
||||
return recipe?.extensions ?? undefined;
|
||||
});
|
||||
|
||||
// Reset form when recipe changes
|
||||
@@ -132,6 +128,10 @@ export default function CreateEditRecipeModal({
|
||||
}
|
||||
}
|
||||
|
||||
const extensions = recipeExtensions?.map((extension) =>
|
||||
'envs' in extension ? { ...extension, envs: undefined } : extension
|
||||
) as ExtensionConfig[] | undefined;
|
||||
|
||||
return {
|
||||
...recipe,
|
||||
title,
|
||||
@@ -141,10 +141,7 @@ export default function CreateEditRecipeModal({
|
||||
prompt: prompt || undefined,
|
||||
parameters: formattedParameters,
|
||||
response: responseConfig,
|
||||
// Strip envs to avoid leaking secrets
|
||||
extensions: recipeExtensions.map((extension) =>
|
||||
'envs' in extension ? { ...extension, envs: undefined } : extension
|
||||
) as ExtensionConfig[],
|
||||
extensions,
|
||||
};
|
||||
}, [
|
||||
recipe,
|
||||
|
||||
Reference in New Issue
Block a user