fix: lists disappearing when updating their namespace

This commit is contained in:
kolaente 2021-09-24 20:51:43 +02:00
parent 1bc6d66895
commit 77f8b27dc6
Signed by untrusted user: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 6 additions and 2 deletions

View File

@ -14,11 +14,15 @@ export default {
},
setNamespaceById(state, namespace) {
const namespaceIndex = state.namespaces.findIndex(n => n.id === namespace.id)
if (namespaceIndex === -1) {
return
}
if (!namespace.lists || namespace.lists.length === 0) {
namespace.lists = state.namespaces[namespaceIndex].lists
}
Vue.set(state.namespaces, namespaceIndex, namespace)
},
setListInNamespaceById(state, list) {