Fix page not rendering if block not found in layout
This commit is contained in:
@@ -593,11 +593,19 @@ export default {
|
||||
return acc
|
||||
}, new Set())
|
||||
|
||||
this.blocks = (this.layout || {}).blocks.map(({ blockID, xywh }) => {
|
||||
const tempBlocks = []
|
||||
const { blocks = [] } = this.layout || {}
|
||||
|
||||
blocks.forEach(({ blockID, xywh }) => {
|
||||
const block = this.page.blocks.find(b => b.blockID === blockID)
|
||||
block.xywh = xywh
|
||||
return block
|
||||
|
||||
if (block) {
|
||||
block.xywh = xywh
|
||||
tempBlocks.push(block)
|
||||
}
|
||||
})
|
||||
|
||||
this.blocks = tempBlocks
|
||||
},
|
||||
|
||||
refetchRecordBlocks () {
|
||||
|
||||
@@ -297,11 +297,19 @@ export default {
|
||||
this.pageTitle = title || handle || this.$t('navigation:noPageTitle')
|
||||
document.title = [title, this.namespace.name, this.$t('general:label.app-name.public')].filter(v => v).join(' | ')
|
||||
|
||||
this.blocks = (this.layout || {}).blocks.map(({ blockID, xywh }) => {
|
||||
const tempBlocks = []
|
||||
const { blocks = [] } = this.layout || {}
|
||||
|
||||
blocks.forEach(({ blockID, xywh }) => {
|
||||
const block = this.page.blocks.find(b => b.blockID === blockID)
|
||||
block.xywh = xywh
|
||||
return block
|
||||
|
||||
if (block) {
|
||||
block.xywh = xywh
|
||||
tempBlocks.push(block)
|
||||
}
|
||||
})
|
||||
|
||||
this.blocks = tempBlocks
|
||||
},
|
||||
|
||||
refetchRecords () {
|
||||
|
||||
Reference in New Issue
Block a user