Fix:Switching library on series item page not redirecting #2902

This commit is contained in:
advplyr 2024-05-01 17:23:49 -05:00
parent cb1ebd4a17
commit 410801347c

View File

@ -83,15 +83,21 @@ export default {
},
async updateLibrary(library) {
var currLibraryId = this.currentLibraryId
if (currLibraryId === library.id) {
return
}
this.disabled = true
await this.$store.dispatch('libraries/fetch', library.id)
if (this.$route.name.startsWith('config')) {
// No need to refresh
} else if (this.$route.name.startsWith('library')) {
var newRoute = this.$route.path.replace(currLibraryId, library.id)
} else if (this.$route.name.startsWith('library') && this.$route.name !== 'library-library-series-id') {
const newRoute = this.$route.path.replace(currLibraryId, library.id)
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 {
this.$router.push(`/library/${library.id}`)
}
@ -107,4 +113,4 @@ export default {
.librariesDropdownMenu {
max-height: calc(100vh - 75px);
}
</style>
</style>