From 0ab5fba0246001dbb674d97207f6046dee62800f Mon Sep 17 00:00:00 2001 From: Miguel Angel Berenguer Date: Fri, 1 Jul 2022 10:01:25 +0200 Subject: [PATCH] Solving Issue #79 --- src/helpers/other-helper.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/helpers/other-helper.ts b/src/helpers/other-helper.ts index 9207186..afd5a36 100644 --- a/src/helpers/other-helper.ts +++ b/src/helpers/other-helper.ts @@ -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; }