Added fix for scenario where componentdefinition was queried befor it existed. Fix to ensure an empty general settings block is not shown

This commit is contained in:
Dean 2023-10-26 10:13:22 +01:00
parent 3b7ed3a7f2
commit 6032216e2f
1 changed files with 9 additions and 5 deletions

View File

@ -34,10 +34,14 @@
setting => setting.section && setting.tag === tag
)
let sections = [
{
name: "General",
settings: generalSettings,
},
...(generalSettings?.length
? [
{
name: "General",
settings: generalSettings,
},
]
: []),
...(customSections || []),
]
@ -142,7 +146,7 @@
<div class="section-info">
<InfoDisplay body={section.info} />
</div>
{:else if idx === 0 && section.name === "General" && componentDefinition.info && !tag}
{:else if idx === 0 && section.name === "General" && componentDefinition?.info && !tag}
<InfoDisplay
title={componentDefinition.name}
body={componentDefinition.info}