diff --git a/client/pages/collection/_id.vue b/client/pages/collection/_id.vue index 12c52322..70b446bd 100644 --- a/client/pages/collection/_id.vue +++ b/client/pages/collection/_id.vue @@ -52,6 +52,11 @@ export default { return redirect('/') } + // If collection is a different library then set library as current + if (collection.libraryId !== store.state.libraries.currentLibraryId) { + await store.dispatch('libraries/fetch', collection.libraryId) + } + store.commit('libraries/addUpdateCollection', collection) return { collectionId: collection.id @@ -87,7 +92,7 @@ export default { }) }, streaming() { - return !!this.playableBooks.find((b) => b.id === this.$store.getters['getLibraryItemIdStreaming']) + return !!this.playableBooks.some((b) => b.id === this.$store.getters['getLibraryItemIdStreaming']) }, showPlayButton() { return this.playableBooks.length @@ -109,14 +114,15 @@ export default { this.$axios .$delete(`/api/collections/${this.collection.id}`) .then(() => { - this.processingRemove = false this.$toast.success(this.$strings.ToastCollectionRemoveSuccess) }) .catch((error) => { console.error('Failed to remove collection', error) - this.processingRemove = false this.$toast.error(this.$strings.ToastCollectionRemoveFailed) }) + .finally(() => { + this.processingRemove = false + }) } }, clickPlay() { diff --git a/client/pages/library/_library/bookshelf/_id.vue b/client/pages/library/_library/bookshelf/_id.vue index 4447b899..ea1a1ff8 100644 --- a/client/pages/library/_library/bookshelf/_id.vue +++ b/client/pages/library/_library/bookshelf/_id.vue @@ -7,7 +7,7 @@