From 75057e2b054fddaeaf98642553ef6f31575f4651 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Thu, 16 Mar 2023 08:35:22 +0000 Subject: [PATCH] Simplify logic --- .../_components/settings/ConditionalUIDrawer.svelte | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/_components/settings/ConditionalUIDrawer.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/_components/settings/ConditionalUIDrawer.svelte index 581b14ae5f..db6e66b87b 100644 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/_components/settings/ConditionalUIDrawer.svelte +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/_components/settings/ConditionalUIDrawer.svelte @@ -72,14 +72,11 @@ }) const makeLabel = setting => { - if (setting.section) { - let label = setting.section - if (setting.label) { - return `${label} - ${setting.label}` - } - return label + const { section, label } = setting + if (section) { + return label ? `${section} - ${label}` : section } else { - return setting.label + return label } }