diff --git a/src-tauri/src/config.rs b/src-tauri/src/config.rs index 7c0642e4..531d6a0d 100644 --- a/src-tauri/src/config.rs +++ b/src-tauri/src/config.rs @@ -398,32 +398,20 @@ impl LauncherConfig { game_name: &String, installed: bool, ) -> Result<(), ConfigError> { - match SupportedGame::from_str(game_name) { - Ok(game) => { - // Retrieve relevant game from config - match self.games.get_mut(&game) { - Some(game) => { - game.is_installed = installed; - if installed { - game.version = self.active_version.clone(); - game.version_folder = self.active_version_folder.clone(); - } else { - game.version = None; - game.version_folder = None; - } - } - None => { - return Err(ConfigError::Configuration(format!( - "Invalid game name - {game_name}, can't update installation status!", - ))); - } - } - } - Err(_) => { - return Err(ConfigError::Configuration(format!( - "Invalid game name - {game_name}, can't update installation status!", - ))); - } + log::info!( + "Updating game installation status: {} - {}", + game_name, + installed + ); + let active_version = self.active_version.clone(); + let active_version_folder = self.active_version_folder.clone(); + let game_config = self.get_supported_game_config_mut(game_name)?; + if installed { + game_config.version = active_version; + game_config.version_folder = active_version_folder; + } else { + game_config.version = None; + game_config.version_folder = None; } self.save_config()?; Ok(()) diff --git a/src/components/games/job/GameJob.svelte b/src/components/games/job/GameJob.svelte index 6b266f24..44c1c06f 100644 --- a/src/components/games/job/GameJob.svelte +++ b/src/components/games/job/GameJob.svelte @@ -122,7 +122,7 @@ return; } progressTracker.proceed(); - await finalizeInstallation("jak1"); + await finalizeInstallation(getInternalName(activeGame)); progressTracker.proceed(); }