mirror of
https://github.com/13hannes11/toolbx-tuner.git
synced 2024-09-03 23:21:00 +02:00
add seperate message for initiating refresh
This commit is contained in:
@@ -41,6 +41,7 @@ pub enum AppMsg {
|
|||||||
pub(super) enum AppCommandMsg {
|
pub(super) enum AppCommandMsg {
|
||||||
PrerequisitsInstalled(bool),
|
PrerequisitsInstalled(bool),
|
||||||
UpdateToolboxes(Vec<ToolbxContainer>),
|
UpdateToolboxes(Vec<ToolbxContainer>),
|
||||||
|
InitiateRefresh,
|
||||||
}
|
}
|
||||||
|
|
||||||
relm4::new_action_group!(pub(super) WindowActionGroup, "win");
|
relm4::new_action_group!(pub(super) WindowActionGroup, "win");
|
||||||
@@ -209,7 +210,7 @@ impl Component for App {
|
|||||||
self.unsupported_dialog.sender().clone().send(()).unwrap()
|
self.unsupported_dialog.sender().clone().send(()).unwrap()
|
||||||
}
|
}
|
||||||
|
|
||||||
AppCommandMsg::PrerequisitsInstalled(true) => {
|
AppCommandMsg::PrerequisitsInstalled(true) | AppCommandMsg::InitiateRefresh => {
|
||||||
// TODO: start process of fetching toolboxes
|
// TODO: start process of fetching toolboxes
|
||||||
self.refresh_spinner.set_spinning(true);
|
self.refresh_spinner.set_spinning(true);
|
||||||
sender.spawn_oneshot_command(|| {
|
sender.spawn_oneshot_command(|| {
|
||||||
@@ -241,7 +242,7 @@ impl Component for App {
|
|||||||
|
|
||||||
sender.spawn_oneshot_command(|| {
|
sender.spawn_oneshot_command(|| {
|
||||||
sleep(Duration::from_millis(2000));
|
sleep(Duration::from_millis(2000));
|
||||||
AppCommandMsg::PrerequisitsInstalled(true)
|
AppCommandMsg::InitiateRefresh
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user