diff --git a/src/routes/console/project-[project]/functions/wizard/step5.svelte b/src/routes/console/project-[project]/functions/wizard/step5.svelte index 4b791b433..2bf16ebda 100644 --- a/src/routes/console/project-[project]/functions/wizard/step5.svelte +++ b/src/routes/console/project-[project]/functions/wizard/step5.svelte @@ -22,7 +22,16 @@ function handleCreated(dispatchEvent: CustomEvent) { createFunction.update((n) => { - n.vars.push(dispatchEvent.detail); + if (n.vars.length) { + n.vars.map((v) => { + if (v.key !== dispatchEvent.detail.key) { + n.vars.push(dispatchEvent.detail); + } + }); + } else { + n.vars.push(dispatchEvent.detail); + } + return n; }); }