diff --git a/anime-game-core b/anime-game-core index 50e612c..2206e00 160000 --- a/anime-game-core +++ b/anime-game-core @@ -1 +1 @@ -Subproject commit 50e612c865eef41076ba70d153051b63ff4ecc1e +Subproject commit 2206e00a963a3e1421a9d45d8f71f32a5c9b7acb diff --git a/components b/components index e87f17c..9f2247a 160000 --- a/components +++ b/components @@ -1 +1 @@ -Subproject commit e87f17c4085ca3617c9673b1139f622b88f8ab20 +Subproject commit 9f2247a8200add10b7da738c257bd824832fa3c6 diff --git a/src/ui/main.rs b/src/ui/main.rs index fee7213..cf07d60 100644 --- a/src/ui/main.rs +++ b/src/ui/main.rs @@ -880,35 +880,38 @@ impl App { self.widgets.status_page.show(); self.widgets.launcher_content.hide(); - let (sender, receiver) = glib::MainContext::channel::(glib::PRIORITY_DEFAULT); let (send, recv) = std::sync::mpsc::channel(); - receiver.attach(None, clone!(@strong self.widgets.status_page as status_page => move |description| { - status_page.set_description(Some(&description)); - - glib::Continue(true) - })); - let this = self.clone(); - std::thread::spawn(move || { - match LauncherState::get(move |status| sender.send(status.to_string()).unwrap()) { - Ok(state) => { - this.set_state(state.clone()); + glib::MainContext::default().invoke(move || { + let (sender, receiver) = glib::MainContext::channel::(glib::PRIORITY_DEFAULT); - this.widgets.status_page.hide(); - this.widgets.launcher_content.show(); + receiver.attach(None, clone!(@strong this.widgets.status_page as status_page => move |description| { + status_page.set_description(Some(&description)); - send.send(Ok(state)).unwrap(); - }, - Err(err) => { - send.send(Err(err.to_string())).unwrap(); + glib::Continue(true) + })); - glib::MainContext::default().invoke(move || { - this.toast("Failed to get initial launcher state", err); - }); + std::thread::spawn(move || { + match LauncherState::get(move |status| sender.send(status.to_string()).unwrap()) { + Ok(state) => { + this.set_state(state.clone()); + + this.widgets.status_page.hide(); + this.widgets.launcher_content.show(); + + send.send(Ok(state)).unwrap(); + }, + Err(err) => { + send.send(Err(err.to_string())).unwrap(); + + glib::MainContext::default().invoke(move || { + this.toast("Failed to get initial launcher state", err); + }); + } } - } + }); }); Await::new(move || {