fix: fixed session applying on each launcher start

This commit is contained in:
Observer KRypt0n_ 2023-05-15 21:43:22 +02:00
parent 9072ad8728
commit a58bd18a79
No known key found for this signature in database
GPG key ID: 844DA47BA25FE1E2
2 changed files with 6 additions and 1 deletions

View file

@ -31,6 +31,7 @@ pub static mut READY: bool = false;
// TODO: get rid of using this function in all the components' events
// e.g. by converting preferences pages into Relm4 Components
/// Check if the app is ready
pub fn is_ready() -> bool {
unsafe { READY }
}

View file

@ -114,7 +114,11 @@ impl SimpleAsyncComponent for GameApp {
set_title: &tr("active-sessions"),
set_subtitle: &tr("active-session-description"),
connect_selected_notify[sender] => move |row| sender.input(GameAppMsg::SetCurrent(row.selected()))
connect_selected_notify[sender] => move |row| {
if is_ready() {
sender.input(GameAppMsg::SetCurrent(row.selected()));
}
}
}
},