Calling $on for $eventHub conditional on its presence.

This code on the mount event for this component when using the embedded viewer on a page is very noisy with respect to $eventHub seemingly being not present on the Vue instance, or at least not at the time of mounting.
This commit is contained in:
Jonathon Broughton
2022-06-05 11:44:27 +01:00
committed by GitHub
parent 437e1558ec
commit 7b505e0241
@@ -164,12 +164,14 @@ export default {
if (this.props) {
this.parseAndSetFilters()
}
this.$eventHub.$on('structure-filters', () => {
this.activeFilter = null
})
this.$eventHub.$on('selection-filters', () => {
this.activeFilter = null
})
if (this.$eventHub) {
this.$eventHub.$on('structure-filters', () => {
this.activeFilter = null
})
this.$eventHub.$on('selection-filters', () => {
this.activeFilter = null
})
}
},
methods: {
parseAndSetFilters() {