Fix record page not loading when navigating to new record from create record view

This commit is contained in:
Jože Fortun
2024-04-17 10:56:02 +02:00
parent d81809c891
commit 9c07c903c8
2 changed files with 20 additions and 12 deletions
@@ -1980,7 +1980,7 @@ export default {
},
handleAddRecord () {
const refRecord = this.options.linkToParent ? this.record : undefined
const refRecord = this.options.linkToParent && this.recordID !== NoID ? this.record : undefined
const pageID = this.recordPageID
if (!(pageID || this.options.rowCreateUrl)) return
@@ -306,25 +306,33 @@ export default {
return this.previousPages.length > 0
},
uniqueID () {
return `${this.page.pageID}-${this.recordID}`
},
},
watch: {
recordID: {
immediate: true,
handler () {
this.record = undefined
this.initialRecordState = undefined
this.refresh()
},
},
'page.pageID': {
immediate: true,
handler (pageID) {
if (pageID === NoID) return
handler () {
console.log('1')
if (this.page.pageID === NoID) return
this.layouts = this.getPageLayouts(this.page.pageID)
this.layout = undefined
console.log('1')
},
},
uniqueID: {
immediate: true,
handler () {
console.log('2')
this.record = undefined
this.initialRecordState = undefined
this.refresh()
console.log('2')
},
},