Skip to content

Commit

Permalink
backend/frontend: don't finalize installation with jak1 hard-coded (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
xTVaser authored Nov 5, 2023
1 parent 398e82d commit 0a2535e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 27 deletions.
40 changes: 14 additions & 26 deletions src-tauri/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(())
Expand Down
2 changes: 1 addition & 1 deletion src/components/games/job/GameJob.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
return;
}
progressTracker.proceed();
await finalizeInstallation("jak1");
await finalizeInstallation(getInternalName(activeGame));
progressTracker.proceed();
}
Expand Down

0 comments on commit 0a2535e

Please sign in to comment.