Fix:Remove collections when removing library

This commit is contained in:
advplyr 2022-11-11 17:44:19 -06:00
parent 6f901defd6
commit 28feed6ea2
6 changed files with 55 additions and 38 deletions

View file

@ -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)
}
}