diff --git a/app/react/portainer/custom-templates/components/utils.ts b/app/react/portainer/custom-templates/components/utils.ts index 315fd4a92..2c2362264 100644 --- a/app/react/portainer/custom-templates/components/utils.ts +++ b/app/react/portainer/custom-templates/components/utils.ts @@ -38,12 +38,15 @@ export function intersectVariables( ) { const oldVariablesWithLabel = oldVariables.filter((v) => !!v.label); - return [ - ...oldVariablesWithLabel, - ...newVariables.filter( - (v) => !oldVariablesWithLabel.find(({ name }) => name === v.name) - ), - ]; + return _.uniqBy( + [ + ...oldVariablesWithLabel, + ...newVariables.filter( + (v) => !oldVariablesWithLabel.find(({ name }) => name === v.name) + ), + ], + 'name' + ); } export function renderTemplate(