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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user