Merge pull request #81 from maberalc/main

Solved Issue #79
This commit is contained in:
MaTeMaTuK 2022-07-10 14:17:35 +02:00 committed by GitHub
commit 557f3a6a9e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -40,11 +40,10 @@ function getChildren(taskList: Task[], task: Task) {
} else {
tasks = taskList.filter(t => t.project && t.project === task.id);
}
const taskChildren = tasks.reduce(
(children: Task[], t) =>
children.concat(children, getChildren(taskList, t)),
[]
);
var taskChildren: Task[] = [];
tasks.forEach(t => {
taskChildren.push(...getChildren(taskList, t));
})
tasks = tasks.concat(tasks, taskChildren);
return tasks;
}