Skip to content

Commit

Permalink
toolbx list is not prefetched before the app launches
Browse files Browse the repository at this point in the history
  • Loading branch information
13hannes11 committed Feb 18, 2024
1 parent b5de805 commit 67a80ed
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
6 changes: 1 addition & 5 deletions src/main.rs
Expand Up @@ -9,13 +9,9 @@ mod ui;
mod util;

fn main() {
let toolbx_list = VecDeque::from(ToolbxContainer::get_toolboxes());
let factory_vec = FactoryVecDeque::new();

let mut model = AppModel {
toolboxes: factory_vec,
toolboxes: FactoryVecDeque::new(),
};
model.update_toolbxes(toolbx_list.into_iter());
let app = RelmApp::new(model);
app.run();
}
2 changes: 1 addition & 1 deletion src/ui/app/workers.rs
Expand Up @@ -65,8 +65,8 @@ impl MessageHandler<AppModel> for AsyncHandler {
let _sender = sender.clone();
rt.spawn(async move {
loop {
tokio::time::sleep(Duration::from_secs(10)).await;
_sender.send(AsyncHandlerMsg::UpdateToolbxes).await;
tokio::time::sleep(Duration::from_secs(10)).await;
}
});

Expand Down

0 comments on commit 67a80ed

Please sign in to comment.