fix(app/mustache): reuse mustache variables in templates [EE-3689] (#7286)

pull/7270/head
LP B 2 years ago committed by GitHub
parent 95f4db4f48
commit 1a8fe82821
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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(

Loading…
Cancel
Save