Don't lose relation to subtasks already in store

Signed-off-by: Raimund Schlüßler <raimund.schluessler@mailbox.org>
This commit is contained in:
Raimund Schlüßler 2019-09-15 16:12:45 +02:00
parent 741af5a5e5
commit 944724e9ad
No known key found for this signature in database
GPG key ID: 036FA7EB1A599178

View file

@ -504,6 +504,14 @@ const actions = {
return list
}, parent.subTasks)
// In case we already have subtasks of this task in the store, add them as well.
const subTasksInStore = context.getters.getTasksByParent(parent)
subTasksInStore.forEach(
subTask => {
context.commit('addTaskToParent', { task: subTask, parent: parent })
}
)
// If necessary, add the tasks as subtasks to parent tasks already present in the store.
if (!related) {
const parentParent = context.getters.getTaskByUid(parent.related)