From 410801347c6e1b6b9f80b1c047d37400a0d29e9c Mon Sep 17 00:00:00 2001 From: advplyr Date: Wed, 1 May 2024 17:23:49 -0500 Subject: [PATCH] Fix:Switching library on series item page not redirecting #2902 --- client/components/ui/LibrariesDropdown.vue | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/client/components/ui/LibrariesDropdown.vue b/client/components/ui/LibrariesDropdown.vue index 587a958b..22abb301 100644 --- a/client/components/ui/LibrariesDropdown.vue +++ b/client/components/ui/LibrariesDropdown.vue @@ -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); } - \ No newline at end of file +