forked from janek/mostr
fix(tasks): do not show children of non-matching states
This commit is contained in:
parent
fd970b3709
commit
617b1ea6d1
24
src/tasks.rs
24
src/tasks.rs
|
@ -381,19 +381,21 @@ impl TasksRelay {
|
||||||
depth: usize,
|
depth: usize,
|
||||||
) -> Vec<&'a Task> {
|
) -> Vec<&'a Task> {
|
||||||
iter.flat_map(move |task| {
|
iter.flat_map(move |task| {
|
||||||
let new_depth = depth - 1;
|
if !self.state.matches(task) {
|
||||||
if new_depth > 0 {
|
return vec![]
|
||||||
let mut children = self.resolve_tasks_rec(self.tasks.children_of(&task), sparse, new_depth);
|
}
|
||||||
if !children.is_empty() {
|
let new_depth = depth - 1;
|
||||||
if !sparse {
|
if new_depth > 0 {
|
||||||
children.push(task);
|
let mut children = self.resolve_tasks_rec(self.tasks.children_of(&task), sparse, new_depth);
|
||||||
}
|
if !children.is_empty() {
|
||||||
return children;
|
if !sparse {
|
||||||
|
children.push(task);
|
||||||
}
|
}
|
||||||
|
return children;
|
||||||
}
|
}
|
||||||
return if self.filter(task) { vec![task] } else { vec![] };
|
}
|
||||||
})
|
return if self.filter(task) { vec![task] } else { vec![] };
|
||||||
.collect_vec()
|
}).collect_vec()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Executes the given function with each task referenced by this event without marker.
|
/// Executes the given function with each task referenced by this event without marker.
|
||||||
|
|
Loading…
Reference in New Issue