hide filters when tags are not defined

This commit is contained in:
lightling 2024-04-10 19:01:04 -04:00
parent 732744d69a
commit 1cfa5e023a

View file

@ -44,18 +44,22 @@ const tagsByCategory = ref({} as { [category: string]: Record<string, string> })
* Handles updating the displayed tags in the list * Handles updating the displayed tags in the list
*/ */
const onLoadTags = () => { const onLoadTags = () => {
tagsByCategory.value = { 'NoCategory': {}} if (!config.tags) {
Object.keys(config.tags).forEach(id => { tagsByCategory.value = null as any
const tag = config.tags[id] } else {
if (!!tag.category) { tagsByCategory.value = { 'NoCategory': {}}
if (!tagsByCategory.value[tag.category]) { Object.keys(config.tags).forEach(id => {
tagsByCategory.value[tag.category] = {} const tag = config.tags[id]
if (!!tag.category) {
if (!tagsByCategory.value[tag.category]) {
tagsByCategory.value[tag.category] = {}
}
tagsByCategory.value[tag.category][id] = tag.displayName || id
} else {
tagsByCategory.value['NoCategory'][id] = tag.displayName || id
} }
tagsByCategory.value[tag.category][id] = tag.displayName || id })
} else { }
tagsByCategory.value['NoCategory'][id] = tag.displayName || id
}
})
} }
/** /**
@ -201,7 +205,7 @@ onMounted(async () => {
) )
Transition Transition
.filters( .filters(
v-if='galleryReady' v-if='galleryReady && !!tagsByCategory'
) )
h2 Filters h2 Filters
.category( .category(