Skip to content

Commit

Permalink
Bugfix for empty cms blocks in icmaa-cms block component (#292)
Browse files Browse the repository at this point in the history
  • Loading branch information
cewald authored Apr 16, 2020
1 parent 11345ff commit f1128d3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/modules/icmaa-cms/components/Block.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<component :class="['cms-content']" :is="content" v-if="loaded" />
<component :class="['cms-content']" :is="content" v-if="loaded && isValidComponent" />
</template>

<script>
Expand Down
3 changes: 3 additions & 0 deletions src/modules/icmaa-cms/mixins/Block.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ export default {
},
content (): object {
return stringToComponent(this.block.content)
},
isValidComponent (): boolean {
return (this.content && Object.keys(this.content).length > 0)
}
},
methods: {
Expand Down

0 comments on commit f1128d3

Please sign in to comment.