mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-01-03 00:06:46 +01:00
Fix:Switching library on series item page not redirecting #2902
This commit is contained in:
parent
cb1ebd4a17
commit
410801347c
@ -83,15 +83,21 @@ export default {
|
|||||||
},
|
},
|
||||||
async updateLibrary(library) {
|
async updateLibrary(library) {
|
||||||
var currLibraryId = this.currentLibraryId
|
var currLibraryId = this.currentLibraryId
|
||||||
|
if (currLibraryId === library.id) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
this.disabled = true
|
this.disabled = true
|
||||||
await this.$store.dispatch('libraries/fetch', library.id)
|
await this.$store.dispatch('libraries/fetch', library.id)
|
||||||
|
|
||||||
if (this.$route.name.startsWith('config')) {
|
if (this.$route.name.startsWith('config')) {
|
||||||
// No need to refresh
|
// No need to refresh
|
||||||
} else if (this.$route.name.startsWith('library')) {
|
} else if (this.$route.name.startsWith('library') && this.$route.name !== 'library-library-series-id') {
|
||||||
var newRoute = this.$route.path.replace(currLibraryId, library.id)
|
const newRoute = this.$route.path.replace(currLibraryId, library.id)
|
||||||
this.$router.push(newRoute)
|
this.$router.push(newRoute)
|
||||||
|
} else if (this.$route.name === 'library-library-series-id' && library.mediaType === 'book') {
|
||||||
|
// For series item page redirect to root series page
|
||||||
|
this.$router.push(`/library/${library.id}/bookshelf/series`)
|
||||||
} else {
|
} else {
|
||||||
this.$router.push(`/library/${library.id}`)
|
this.$router.push(`/library/${library.id}`)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user