Fix refresh all record values prompt in modal

This commit is contained in:
Jože Fortun
2023-09-26 09:55:18 +02:00
parent 8e03ea56ef
commit daf1caeb1d
2 changed files with 6 additions and 6 deletions
@@ -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',