diff --git a/boot_diags/src/app.rs b/boot_diags/src/app.rs index 6854bf8..b0d7a05 100644 --- a/boot_diags/src/app.rs +++ b/boot_diags/src/app.rs @@ -296,14 +296,12 @@ impl App { // Check background task(s) match self.cur_mode { Mode::BootDiags => { - // Check result of background task (if finished) if let Some(task) = self.tasks.poll()? { // TODO: Impl logic } } Mode::ScanDisks => { - // Check background task (Once all are complete Action::NextScreen is sent) - self.tasks.poll()?; + let _ = self.tasks.poll()?; } _ => {} } @@ -385,6 +383,13 @@ impl App { self.action_tx.send(build_right_items(self))?; self.action_tx.send(Action::Select(None, None))?; } + Action::TasksComplete => { + if self.cur_mode == Mode::BootDiags { + self.action_tx.send(Action::DismissPopup)?; + } else { + self.action_tx.send(Action::NextScreen)?; + } + } _ => {} } for component in &mut self.components { diff --git a/core/src/action.rs b/core/src/action.rs index b2928a2..5db5638 100644 --- a/core/src/action.rs +++ b/core/src/action.rs @@ -29,6 +29,7 @@ pub enum Action { ScanDisks, Select(Option, Option), // indicies for (source, dest) etc SelectRight(Option, Option), // indicies for right info pane + TasksComplete, UpdateDiskList(Vec), UpdateFooter(String), UpdateLeft(String, Vec, Vec, usize), // (title, labels, items, select_num) diff --git a/core/src/tasks.rs b/core/src/tasks.rs index 296ea6a..92fe95b 100644 --- a/core/src/tasks.rs +++ b/core/src/tasks.rs @@ -114,7 +114,7 @@ impl Tasks { } // Check status of current task (if one is running). - // NOTE: Action::NextScreen is sent once all tasks are complete + // NOTE: Action::TasksComplete is sent once all tasks are complete if let Some(task_handle) = self.cur_handle.take() { if task_handle.is_finished() { // Need to return task with handle @@ -124,7 +124,7 @@ impl Tasks { } if self.task_list.is_empty() { // No tasks remain - self.action_tx.send(Action::NextScreen)?; + self.action_tx.send(Action::TasksComplete)?; } else { // Start next task self.start()?; diff --git a/deja_vu/src/app.rs b/deja_vu/src/app.rs index 7ee37dd..0c3cb20 100644 --- a/deja_vu/src/app.rs +++ b/deja_vu/src/app.rs @@ -530,6 +530,7 @@ impl App { _ => {} }; } + Action::TasksComplete => self.action_tx.send(Action::NextScreen)?, _ => {} } for component in &mut self.components {