diff --git a/client/web/compose/src/views/Public/Pages/Records/View.vue b/client/web/compose/src/views/Public/Pages/Records/View.vue index c045590d4..37eaf7886 100644 --- a/client/web/compose/src/views/Public/Pages/Records/View.vue +++ b/client/web/compose/src/views/Public/Pages/Records/View.vue @@ -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 () { diff --git a/client/web/compose/src/views/Public/Pages/View.vue b/client/web/compose/src/views/Public/Pages/View.vue index 8f355cc7d..8b7ec05ba 100644 --- a/client/web/compose/src/views/Public/Pages/View.vue +++ b/client/web/compose/src/views/Public/Pages/View.vue @@ -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 () {