aboutsummaryrefslogtreecommitdiff
path: root/src-tauri/src
diff options
context:
space:
mode:
authorGeckoEidechse <40122905+GeckoEidechse@users.noreply.github.com>2022-11-30 18:30:23 +0100
committerGitHub <noreply@github.com>2022-11-30 18:30:23 +0100
commite301086cbb26fcb1d9e520c016b00233aba0f315 (patch)
tree5b773aa4afc9ebedc9cb06ad38f5dc3671a591fc /src-tauri/src
parent7c0c58d1a3b7471fc5422cd4536fa41441db4359 (diff)
downloadFlightCore-e301086cbb26fcb1d9e520c016b00233aba0f315.tar.gz
FlightCore-e301086cbb26fcb1d9e520c016b00233aba0f315.zip
refactor: Remove the "Origin running" check from frontend (#94)
* refactor: Remove Origin running check in frontend We already perform the check in the backend. Frontend does not check for OS and as such on Linux will just always tell you that Origin is not running. * feat: Show notification toast, not alert pop-up * refactor: Perform OS check before Origin check
Diffstat (limited to 'src-tauri/src')
-rw-r--r--src-tauri/src/lib.rs30
1 files changed, 15 insertions, 15 deletions
diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs
index 4a817af9..ba89cc0a 100644
--- a/src-tauri/src/lib.rs
+++ b/src-tauri/src/lib.rs
@@ -241,6 +241,21 @@ pub fn launch_northstar(
) -> Result<String, String> {
dbg!(game_install.clone());
+ let host_os = get_host_os();
+
+ // Explicitly fail early certain (currently) unsupported install setups
+ if host_os != "windows"
+ || !(matches!(game_install.install_type, InstallType::STEAM)
+ || matches!(game_install.install_type, InstallType::ORIGIN)
+ || matches!(game_install.install_type, InstallType::UNKNOWN))
+ {
+ return Err(format!(
+ "Not yet implemented for \"{}\" with Titanfall2 installed via \"{:?}\"",
+ get_host_os(),
+ game_install.install_type
+ ));
+ }
+
let bypass_checks = match bypass_checks {
Some(bypass_checks) => bypass_checks,
None => false,
@@ -262,21 +277,6 @@ pub fn launch_northstar(
}
}
- let host_os = get_host_os();
-
- // Explicetly fail early certain (currently) unsupported install setups
- if host_os != "windows"
- || !(matches!(game_install.install_type, InstallType::STEAM)
- || matches!(game_install.install_type, InstallType::ORIGIN)
- || matches!(game_install.install_type, InstallType::UNKNOWN))
- {
- return Err(format!(
- "Not yet implemented for \"{}\" with Titanfall2 installed via \"{:?}\"",
- get_host_os(),
- game_install.install_type
- ));
- }
-
// Switch to Titanfall2 directory for launching
// NorthstarLauncher.exe expects to be run from that folder
if std::env::set_current_dir(game_install.game_path.clone()).is_err() {