From ab7b35f634b30eaa442c656cbe58a8319804b2d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C5=BEe=20Fortun?= Date: Fri, 19 May 2023 16:49:02 +0200 Subject: [PATCH] Fix record variable not available in layout expressions --- .../compose/src/views/Public/Pages/Records/View.vue | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) 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 923bfde21..f30a4039c 100644 --- a/client/web/compose/src/views/Public/Pages/Records/View.vue +++ b/client/web/compose/src/views/Public/Pages/Records/View.vue @@ -235,7 +235,9 @@ export default { immediate: true, handler () { this.record = undefined - this.loadRecord() + this.loadRecord().then(() => { + this.determineLayout() + }) }, }, @@ -246,8 +248,6 @@ export default { this.layouts = this.getPageLayouts(this.page.pageID) this.layout = undefined - - this.determineLayout() }, }, }, @@ -290,12 +290,9 @@ export default { const module = Object.freeze(this.getModuleByID(moduleID).clone()) if (this.recordID && this.recordID !== NoID) { - await this.$ComposeAPI - .recordRead({ namespaceID, moduleID, recordID: this.recordID }) + return this.$ComposeAPI.recordRead({ namespaceID, moduleID, recordID: this.recordID }) .then(record => { - setTimeout(() => { - this.record = new compose.Record(module, record) - }, 300) + this.record = new compose.Record(module, record) }) .catch(this.toastErrorHandler(this.$t('notification:record.loadFailed'))) } else {