mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2026-08-29 22:57:16 +02:00
Update:Redirect when changing libraries
This commit is contained in:
@@ -395,6 +395,11 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
libraryChanged() {
|
libraryChanged() {
|
||||||
|
if (this.currentLibraryMediaType !== 'book' && (this.page === 'series' || this.page === 'collections' || this.page === 'series-books')) {
|
||||||
|
this.$router.replace('/bookshelf')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if (this.hasFilter) {
|
if (this.hasFilter) {
|
||||||
this.clearFilter()
|
this.clearFilter()
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -131,9 +131,20 @@ export default {
|
|||||||
this.selectedPodcast = podcast
|
this.selectedPodcast = podcast
|
||||||
this.showSelectedFeed = true
|
this.showSelectedFeed = true
|
||||||
console.log('Got podcast feed', payload.podcast)
|
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>
|
</script>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user