mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-01-13 09:28:20 +01:00
Fix:Collection page set library on refresh
This commit is contained in:
parent
084bea6b15
commit
c1360267c6
@ -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() {
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
<script>
|
||||
export default {
|
||||
async asyncData({ params, query, store, app, redirect }) {
|
||||
async asyncData({ params, query, store, redirect }) {
|
||||
var libraryId = params.library
|
||||
var libraryData = await store.dispatch('libraries/fetch', libraryId)
|
||||
if (!libraryData) {
|
||||
|
Loading…
Reference in New Issue
Block a user