mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-30 06:39:37 +02:00
Route from Issues to Library if last issue is removed
This commit is contained in:
parent
364ccd85fe
commit
6c0e42db49
1 changed files with 13 additions and 0 deletions
|
@ -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) {
|
libraryItemRemoved(libraryItem) {
|
||||||
if (this.entityName === 'items' || this.entityName === 'series-books') {
|
if (this.entityName === 'items' || this.entityName === 'series-books') {
|
||||||
var indexOf = this.entities.findIndex((ent) => ent && ent.id === libraryItem.id)
|
var indexOf = this.entities.findIndex((ent) => ent && ent.id === libraryItem.id)
|
||||||
|
@ -578,6 +590,7 @@ export default {
|
||||||
this.executeRebuild()
|
this.executeRebuild()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
this.routeToBookshelfIfLastIssueRemoved()
|
||||||
},
|
},
|
||||||
libraryItemsAdded(libraryItems) {
|
libraryItemsAdded(libraryItems) {
|
||||||
console.log('items added', libraryItems)
|
console.log('items added', libraryItems)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue