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