From 7bfd07ac6ceb9297a969f98a0d1ccd9b55882bf7 Mon Sep 17 00:00:00 2001 From: Dean Date: Fri, 21 Oct 2022 15:33:56 +0100 Subject: [PATCH] Ensure bindings are not mutated when enriching with custom icons --- .../src/components/automation/SetupPanel/RowSelector.svelte | 5 +++-- .../components/automation/SetupPanel/RowSelectorTypes.svelte | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/builder/src/components/automation/SetupPanel/RowSelector.svelte b/packages/builder/src/components/automation/SetupPanel/RowSelector.svelte index b3d50c1658..e5a5b2af8c 100644 --- a/packages/builder/src/components/automation/SetupPanel/RowSelector.svelte +++ b/packages/builder/src/components/automation/SetupPanel/RowSelector.svelte @@ -15,8 +15,9 @@ export let isTestModal $: parsedBindings = bindings.map(binding => { - binding.icon = "ShareAndroid" - return binding + let clone = Object.assign({}, binding) + clone.icon = "ShareAndroid" + return clone }) let table diff --git a/packages/builder/src/components/automation/SetupPanel/RowSelectorTypes.svelte b/packages/builder/src/components/automation/SetupPanel/RowSelectorTypes.svelte index ee95ee613f..0e5e13ce1e 100644 --- a/packages/builder/src/components/automation/SetupPanel/RowSelectorTypes.svelte +++ b/packages/builder/src/components/automation/SetupPanel/RowSelectorTypes.svelte @@ -21,8 +21,9 @@ export let isTestModal $: parsedBindings = bindings.map(binding => { - binding.icon = "ShareAndroid" - return binding + let clone = Object.assign({}, binding) + clone.icon = "ShareAndroid" + return clone }) function schemaHasOptions(schema) {