mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-07-09 14:25:25 +02:00
Fix manage, chapters edit tracks and library stats page not setting the current library properly #4170
This commit is contained in:
@@ -89,14 +89,16 @@
|
||||
|
||||
<script>
|
||||
export default {
|
||||
asyncData({ redirect, store }) {
|
||||
async asyncData({ redirect, store, params }) {
|
||||
if (!store.getters['user/getIsAdminOrUp']) {
|
||||
redirect('/')
|
||||
return
|
||||
}
|
||||
|
||||
if (!store.state.libraries.currentLibraryId) {
|
||||
return redirect('/config')
|
||||
const libraryId = params.library
|
||||
const library = await store.dispatch('libraries/fetch', libraryId)
|
||||
if (!library) {
|
||||
return redirect(`/oops?message=Library "${libraryId}" not found`)
|
||||
}
|
||||
return {}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user