Skip to content

Commit

Permalink
fix: undefined category name in page title #413
Browse files Browse the repository at this point in the history
  • Loading branch information
wazolab committed Nov 5, 2024
1 parent 69d007b commit bd3f8fe
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pages/poi/[id]/details.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const siteStore = useSiteStore()
const { config, settings, contents } = storeToRefs(siteStore)
const { params } = useRoute()
const { $trackingInit } = useNuxtApp()
const { locale } = useI18n()
//
// Data
Expand Down Expand Up @@ -64,7 +65,7 @@ poi.value = poiPoiDeps.value.poi
poiDeps.value = poiPoiDeps.value.poiDeps
if (!poi.value) {
showError({
throw showError({
statusCode: 404,
statusMessage: 'POI not found. Missing main object.',
})
Expand All @@ -77,7 +78,9 @@ const pageTitle = computed(() => {
if (!poi.value)
return ''
return `${poi.value.properties.classe} - ${poi.value.properties.name}`
return poi.value.properties.editorial?.class_label_details && poi.value.properties.editorial.class_label_details[locale.value]
? `${poi.value.properties.editorial.class_label_details[locale.value]} - ${poi.value.properties.name}`
: poi.value.properties.name
})
//
Expand Down

0 comments on commit bd3f8fe

Please sign in to comment.