mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-05-24 01:13:00 -04:00
Route from Issues to Library if last issue is removed
This commit is contained in:
parent
364ccd85fe
commit
6c0e42db49
@ -568,6 +568,18 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
routeToBookshelfIfLastIssueRemoved() {
|
||||
if (this.totalEntities === 0) {
|
||||
const currentRouteQuery = this.$route.query
|
||||
if (currentRouteQuery?.filter && currentRouteQuery.filter === 'issues') {
|
||||
this.$nextTick(() => {
|
||||
console.log('Last issue removed. Redirecting to library bookshelf')
|
||||
this.$router.push(`/library/${this.currentLibraryId}/bookshelf`)
|
||||
this.$store.dispatch('libraries/fetch', this.currentLibraryId)
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
libraryItemRemoved(libraryItem) {
|
||||
if (this.entityName === 'items' || this.entityName === 'series-books') {
|
||||
var indexOf = this.entities.findIndex((ent) => ent && ent.id === libraryItem.id)
|
||||
@ -578,6 +590,7 @@ export default {
|
||||
this.executeRebuild()
|
||||
}
|
||||
}
|
||||
this.routeToBookshelfIfLastIssueRemoved()
|
||||
},
|
||||
libraryItemsAdded(libraryItems) {
|
||||
console.log('items added', libraryItems)
|
||||
|
Loading…
x
Reference in New Issue
Block a user