Skip to content

Commit

Permalink
Guard alternates
Browse files Browse the repository at this point in the history
  • Loading branch information
benjick committed May 5, 2020
1 parent 4b24f1d commit 5acb823
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/vsf-storyblok-module/pages/Storyblok.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ export default {
methods: {
metaHreflangLinks () {
const { hreflangPrefix } = getSettings(config.storyblok.settings)
if (hreflangPrefix && this.story && this.story.alternates.length > 0) {
const alternates = get(this.story, 'alternates', [])
if (hreflangPrefix && alternates.length > 0) {
const alternateHreflangLinks = this.story.alternates.filter(altStory => {
const storeCode = this.storeCodeFromSlug(altStory.full_slug)
return get(config.storeViews, [storeCode, 'disabled'], true) === false
Expand Down

0 comments on commit 5acb823

Please sign in to comment.