diff --git a/src/views/project/ProjectList.vue b/src/views/project/ProjectList.vue index 35b91c411..ef4a22ffe 100644 --- a/src/views/project/ProjectList.vue +++ b/src/views/project/ProjectList.vue @@ -179,7 +179,23 @@ watch( if (projectId < 0) { return } - tasks.value = tasks.value.filter(t => typeof t.relatedTasks?.parenttask === 'undefined') + const tasksById = {} + tasks.value.forEach(t => tasksById[t.id] = true) + + tasks.value = tasks.value.filter(t => { + if (typeof t.relatedTasks?.parenttask === 'undefined') { + return true + } + + // If the task is a subtask, make sure the parent task is available in the current view as well + for (const pt of t.relatedTasks.parenttask) { + if(typeof tasksById[pt.id] === 'undefined') { + return true + } + } + + return false + }) }, )