From 5911c0e0ccd289e58e41a80d4c097665baf43603 Mon Sep 17 00:00:00 2001 From: Jan Date: Fri, 7 Jul 2023 23:17:00 +0200 Subject: fix: Pass launch options to Steam (#392) Relying on a file to be parsed in time is unreliably, and if the file is open while we delete it we may run into locking problems. Downside is that this gives a fugly prompt --- src-tauri/src/main.rs | 43 ++----------------------------------------- 1 file changed, 2 insertions(+), 41 deletions(-) (limited to 'src-tauri') diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index 9d3b8297..5d71713a 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -453,10 +453,6 @@ async fn get_available_northstar_versions() -> Result Ok("Started game".to_string()), Err(_err) => Err("Failed to launch Titanfall 2 via Steam".to_string()), - }; - - let is_err = retval.is_err(); - - // Handle the rest in the backround - tauri::async_runtime::spawn(async move { - // Starting the EA app and Titanfall might take a good minute or three - let mut wait_countdown = 60 * 3; - while wait_countdown > 0 && !util::check_northstar_running() && !is_err { - sleep(Duration::from_millis(1000)).await; - wait_countdown -= 1; - } - - // Northstar may be running, but it may not have loaded the file yet - sleep(Duration::from_millis(2000)).await; - - // intentionally ignore Result - let _ = fs::remove_file(run_northstar); - - if Path::new(run_northstar_bak).exists() { - fs::rename(run_northstar_bak, run_northstar).unwrap(); - } - }); - - retval + } } -- cgit v1.2.3