mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-07-18 18:04:29 +02:00
Fix:Remove collections when removing library
This commit is contained in:
parent
6f901defd6
commit
28feed6ea2
6 changed files with 55 additions and 38 deletions
|
@ -9,8 +9,7 @@ export const state = () => ({
|
|||
collapseSeries: false,
|
||||
collapseBookSeries: false
|
||||
},
|
||||
settingsListeners: [],
|
||||
collections: []
|
||||
settingsListeners: []
|
||||
})
|
||||
|
||||
export const getters = {
|
||||
|
@ -57,9 +56,6 @@ export const getters = {
|
|||
if (!state.user) return false
|
||||
if (getters.getUserCanAccessAllLibraries) return true
|
||||
return getters.getLibrariesAccessible.includes(libraryId)
|
||||
},
|
||||
getCollection: state => id => {
|
||||
return state.collections.find(c => c.id === id)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -163,16 +159,5 @@ export const mutations = {
|
|||
},
|
||||
removeSettingsListener(state, listenerId) {
|
||||
state.settingsListeners = state.settingsListeners.filter(l => l.id !== listenerId)
|
||||
},
|
||||
addUpdateCollection(state, collection) {
|
||||
var index = state.collections.findIndex(c => c.id === collection.id)
|
||||
if (index >= 0) {
|
||||
state.collections.splice(index, 1, collection)
|
||||
} else {
|
||||
state.collections.push(collection)
|
||||
}
|
||||
},
|
||||
removeCollection(state, collection) {
|
||||
state.collections = state.collections.filter(c => c.id !== collection.id)
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue