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