fix: negative logic and early return in start xrservice func
Some checks failed
/ cargo-fmtcheck (push) Has been cancelled
/ cargo-clippy (push) Has been cancelled
/ cargo-test (push) Has been cancelled
/ appimage (push) Has been cancelled

This commit is contained in:
Gabriele Musco 2024-11-29 19:40:16 +01:00
commit 3f846b26e0
No known key found for this signature in database
GPG key ID: 1068D795C80E51DE

View file

@ -163,7 +163,17 @@ impl App {
pub fn start_xrservice(&mut self, sender: AsyncComponentSender<Self>, debug: bool) {
self.xrservice_ready = false;
let prof = self.get_selected_profile();
if prof.can_start() {
if !prof.can_start() {
alert(
"Failed to start profile",
Some(concat!(
"You need to build the current profile before starting it.",
"\n\nYou can do this from the menu."
)),
Some(&self.app_win.clone().upcast::<gtk::Window>()),
);
return;
}
if let Err(e) = set_current_active_runtime_to_profile(&prof) {
alert(
"Failed to start XR Service",
@ -213,16 +223,6 @@ impl App {
.emit(DebugViewMsg::XRServiceActiveChanged(true));
self.set_inhibit_session(true);
sender.input(Msg::StartProber);
} else {
alert(
"Failed to start profile",
Some(concat!(
"You need to build the current profile before starting it.",
"\n\nYou can do this from the menu."
)),
Some(&self.app_win.clone().upcast::<gtk::Window>()),
);
}
}
pub fn run_autostart(&mut self, sender: AsyncComponentSender<Self>) {