Fix refresh all record values prompt in modal
This commit is contained in:
@@ -106,6 +106,7 @@ export default {
|
||||
|
||||
mounted () {
|
||||
this.$root.$on('show-record-modal', this.loadRecord)
|
||||
this.$root.$on('refetch-records', this.refetchRecords)
|
||||
|
||||
const { recordID, recordPageID } = this.$route.query
|
||||
|
||||
@@ -173,6 +174,10 @@ export default {
|
||||
}, 300)
|
||||
},
|
||||
|
||||
refetchRecords () {
|
||||
this.$root.$emit('refetch-record-blocks')
|
||||
},
|
||||
|
||||
setDefaultValues () {
|
||||
this.showModal = false
|
||||
this.recordID = undefined
|
||||
@@ -184,6 +189,7 @@ export default {
|
||||
|
||||
destroyEvents () {
|
||||
this.$root.$off('show-record-modal', this.loadRecord)
|
||||
this.$root.$off('refetch-records', this.refetchRecords)
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -321,12 +321,6 @@ export default {
|
||||
this.setDefaultValues()
|
||||
},
|
||||
|
||||
// Destroy event before route leave to ensure it doesn't destroy the newly created one
|
||||
beforeRouteLeave (to, from, next) {
|
||||
this.$root.$off('refetch-record-blocks', this.refetchRecordBlocks)
|
||||
next()
|
||||
},
|
||||
|
||||
methods: {
|
||||
...mapActions({
|
||||
popPreviousPages: 'ui/popPreviousPages',
|
||||
|
||||
Reference in New Issue
Block a user