Simplify logic

This commit is contained in:
Andrew Kingston 2023-03-16 08:35:22 +00:00
parent 8d79a23700
commit 75057e2b05
1 changed files with 4 additions and 7 deletions

View File

@ -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
}
}