Skip to content

Commit fe31732

Browse files
author
Dmitry Yadrikhinsky
committed
[TaskList] Fix checking tasks
1 parent 5c9c19a commit fe31732

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/screens/projects/Projects.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const TaskList = TreeList(
2525
{
2626
checkable: true,
2727
onCheck(keys) {
28-
tasksStore.checkTasks(keys as string[]);
28+
tasksStore.checkTasks(projectStore.activeProject, keys as string[]);
2929
},
3030
getCheckedKeys() {
3131
return tasksStore.getCheckedKeys(projectStore.activeProject);

src/services/tasks/TaskStore.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,10 @@ export default class TaskStore {
6666
return [];
6767
}
6868

69-
checkTasks(taskIds: string[]) {
70-
Object.keys(this.tasks).forEach((projectId) => {
69+
checkTasks(projectId: string, taskIds: string[]) {
70+
if (Array.isArray(this.tasks[projectId])) {
7171
this.checkTasksRecursive(this.tasks[projectId], taskIds);
72-
});
72+
}
7373
}
7474

7575
private getCheckedKeysRecursive(tasks: TaskModel[], checkedIds: string[]) {

0 commit comments

Comments
 (0)