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 { } else {
tasks = taskList.filter(t => t.project && t.project === task.id); tasks = taskList.filter(t => t.project && t.project === task.id);
} }
const taskChildren = tasks.reduce( var taskChildren: Task[] = [];
(children: Task[], t) => tasks.forEach(t => {
children.concat(children, getChildren(taskList, t)), taskChildren.push(...getChildren(taskList, t));
[] })
);
tasks = tasks.concat(tasks, taskChildren); tasks = tasks.concat(tasks, taskChildren);
return tasks; return tasks;
} }