diff --git a/client/web/compose/src/components/Public/Record/Modal.vue b/client/web/compose/src/components/Public/Record/Modal.vue index d8f12af0d..e6356677c 100644 --- a/client/web/compose/src/components/Public/Record/Modal.vue +++ b/client/web/compose/src/components/Public/Record/Modal.vue @@ -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) }, }, } 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 e0149c36a..c0c1096a9 100644 --- a/client/web/compose/src/views/Public/Pages/Records/View.vue +++ b/client/web/compose/src/views/Public/Pages/Records/View.vue @@ -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',