task: Add "remove" button next to oneshot tasks (#10083)
Release Notes: - Added a "remove" button next to oneshot tasks in tasks modal.
This commit is contained in:
parent
a1cb6772bf
commit
8df888e5b1
2 changed files with 58 additions and 1 deletions
|
@ -75,6 +75,13 @@ impl OneshotSource {
|
|||
new_oneshot
|
||||
}
|
||||
}
|
||||
/// Removes a task with a given ID from this source.
|
||||
pub fn remove(&mut self, id: &TaskId) {
|
||||
let position = self.tasks.iter().position(|task| task.id() == id);
|
||||
if let Some(position) = position {
|
||||
self.tasks.remove(position);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl TaskSource for OneshotSource {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue