From 514fb5f7dadb934f53e7238e0047af7c486c8cd5 Mon Sep 17 00:00:00 2001 From: advplyr Date: Mon, 24 Jun 2024 16:37:02 -0500 Subject: [PATCH] Fix ItemSlider component select --- client/components/widgets/ItemSlider.vue | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/client/components/widgets/ItemSlider.vue b/client/components/widgets/ItemSlider.vue index dee53377..b2aa2b28 100644 --- a/client/components/widgets/ItemSlider.vue +++ b/client/components/widgets/ItemSlider.vue @@ -192,25 +192,15 @@ export default { }, mounted() { this.setScrollVars() - switch (this.type) { - case 'series': - return - case 'authors': - return - default: - this.$eventBus.$on('bookshelf_clear_selection', this.clearSelectedEntities) - this.$eventBus.$on('item-selected', this.itemSelectedEvt) + if (['book', 'podcast', 'episode'].includes(this.type)) { + this.$eventBus.$on('bookshelf_clear_selection', this.clearSelectedEntities) + this.$eventBus.$on('item-selected', this.itemSelectedEvt) } }, beforeDestroy() { - switch (this.type) { - case 'series': - return - case 'authors': - return - default: - this.$eventBus.$off('bookshelf_clear_selection', this.clearSelectedEntities) - this.$eventBus.$off('item-selected', this.itemSelectedEvt) + if (['book', 'podcast', 'episode'].includes(this.type)) { + this.$eventBus.$off('bookshelf_clear_selection', this.clearSelectedEntities) + this.$eventBus.$off('item-selected', this.itemSelectedEvt) } } }