Update:Redirect when changing libraries

This commit is contained in:
advplyr
2023-01-11 17:29:49 -06:00
parent 716d07c74e
commit f75a8dfb86
2 changed files with 17 additions and 1 deletions
+12 -1
View File
@@ -131,9 +131,20 @@ export default {
this.selectedPodcast = podcast
this.showSelectedFeed = true
console.log('Got podcast feed', payload.podcast)
},
libraryChanged() {
const libraryMediaType = this.$store.getters['libraries/getCurrentLibraryMediaType']
if (libraryMediaType !== 'podcast') {
this.$router.replace('/bookshelf')
}
}
},
mounted() {}
mounted() {
this.$eventBus.$on('library-changed', this.libraryChanged)
},
beforeDestroy() {
this.$eventBus.$off('library-changed', this.libraryChanged)
}
}
</script>