aboutsummaryrefslogtreecommitdiff
path: root/src-tauri/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src-tauri/src/main.rs')
-rw-r--r--src-tauri/src/main.rs11
1 files changed, 10 insertions, 1 deletions
diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs
index 97c77fa4..fd171468 100644
--- a/src-tauri/src/main.rs
+++ b/src-tauri/src/main.rs
@@ -10,7 +10,7 @@ use std::{
};
use app::{
- check_is_valid_game_path, find_game_install_location, get_host_os,
+ check_is_valid_game_path, check_origin_running, find_game_install_location, get_host_os,
get_northstar_version_number, install_northstar, launch_northstar, GameInstall,
};
use tauri::{Manager, State};
@@ -40,6 +40,15 @@ fn main() {
app_handle.emit_all("backend-ping", "ping").unwrap();
}
});
+ let app_handle = app.app_handle();
+ tauri::async_runtime::spawn(async move {
+ loop {
+ sleep(Duration::from_millis(2000)).await;
+ app_handle
+ .emit_all("origin-running-ping", check_origin_running())
+ .unwrap();
+ }
+ });
Ok(())
})