Skip to content

Commit

Permalink
Fix record page not loading when navigating to new record from create…
Browse files Browse the repository at this point in the history
… record view
  • Loading branch information
Fajfa committed Apr 17, 2024
1 parent d81809c commit 9c07c90
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 11 deletions.
Expand Up @@ -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
Expand Down
28 changes: 18 additions & 10 deletions client/web/compose/src/views/Public/Pages/Records/View.vue
Expand Up @@ -306,25 +306,33 @@ export default {
return this.previousPages.length > 0
},
uniqueID () {
return `${this.page.pageID}-${this.recordID}`
},
},
watch: {
recordID: {
'page.pageID': {
immediate: true,
handler () {
this.record = undefined
this.initialRecordState = undefined
this.refresh()
console.log('1')
if (this.page.pageID === NoID) return
this.layouts = this.getPageLayouts(this.page.pageID)
this.layout = undefined
console.log('1')
},
},
'page.pageID': {
uniqueID: {
immediate: true,
handler (pageID) {
if (pageID === NoID) return
this.layouts = this.getPageLayouts(this.page.pageID)
this.layout = undefined
handler () {
console.log('2')
this.record = undefined
this.initialRecordState = undefined
this.refresh()
console.log('2')
},
},
Expand Down

0 comments on commit 9c07c90

Please sign in to comment.