From e695396bb88ae45154949d3181ded650c3948c89 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 3 Dec 2021 11:38:49 +0000 Subject: [PATCH 1/2] Ensure links prop is always an array when configuring layout links --- .../PropertyControls/NavigationEditor/NavigationDrawer.svelte | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/NavigationEditor/NavigationDrawer.svelte b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/NavigationEditor/NavigationDrawer.svelte index 4d1823108c..4301028ba0 100644 --- a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/NavigationEditor/NavigationDrawer.svelte +++ b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/NavigationEditor/NavigationDrawer.svelte @@ -17,6 +17,7 @@ const flipDurationMs = 150 let dragDisabled = true + $: links = links || [] $: links.forEach(link => { if (!link.id) { link.id = generate() From 39d5c81b72ab3f6fee18139cb399c4416f38eaf7 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 3 Dec 2021 11:45:04 +0000 Subject: [PATCH 2/2] Ensure links are an array in the wrapper component for a cleaner fix --- .../PropertyControls/NavigationEditor/NavigationDrawer.svelte | 1 - .../PropertyControls/NavigationEditor/NavigationEditor.svelte | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/NavigationEditor/NavigationDrawer.svelte b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/NavigationEditor/NavigationDrawer.svelte index 4301028ba0..4d1823108c 100644 --- a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/NavigationEditor/NavigationDrawer.svelte +++ b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/NavigationEditor/NavigationDrawer.svelte @@ -17,7 +17,6 @@ const flipDurationMs = 150 let dragDisabled = true - $: links = links || [] $: links.forEach(link => { if (!link.id) { link.id = generate() diff --git a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/NavigationEditor/NavigationEditor.svelte b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/NavigationEditor/NavigationEditor.svelte index ea02b4184d..40357f50be 100644 --- a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/NavigationEditor/NavigationEditor.svelte +++ b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/NavigationEditor/NavigationEditor.svelte @@ -6,7 +6,7 @@ export let value = [] let drawer - let links = cloneDeep(value) + let links = cloneDeep(value || []) const dispatch = createEventDispatcher() const save = () => {