diff options
author | GeckoEidechse <gecko.eidechse+git@pm.me> | 2022-09-11 00:32:55 +0200 |
---|---|---|
committer | GeckoEidechse <gecko.eidechse+git@pm.me> | 2022-09-11 00:32:55 +0200 |
commit | 504c1bc00e9d27a3df9a300ba2ebd8aa9efbb3ab (patch) | |
tree | bb3785aa3f4f8d03c1e245e73c8435b06c69c1ce /src-tauri/src/main.rs | |
parent | 6097f17765e5f4303a25f58e1ad07b5dbb79233b (diff) | |
download | FlightCore-504c1bc00e9d27a3df9a300ba2ebd8aa9efbb3ab.tar.gz FlightCore-504c1bc00e9d27a3df9a300ba2ebd8aa9efbb3ab.zip |
Check if Origin is running
Diffstat (limited to 'src-tauri/src/main.rs')
-rw-r--r-- | src-tauri/src/main.rs | 11 |
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(()) }) |