diff --git a/src/ui/main/repair_game.rs b/src/ui/main/repair_game.rs index 70a1942..0c71173 100644 --- a/src/ui/main/repair_game.rs +++ b/src/ui/main/repair_game.rs @@ -105,11 +105,45 @@ pub fn repair_game(sender: ComponentSender, progress_bar_input: Sender patch, + Err(err) => { + // TODO: do we really need this toast message here? Perhaps it's not an error but a warning? + sender.input(AppMsg::Toast { + title: tr("patch-info-fetching-error"), + description: Some(err.to_string()) + }); + + tracing::error!("Failed to get player patch status: {err}. Used config value instead: {}", config.patch.apply_main); + + config.patch.apply_main + } + }; + + // Get xlua patch status + + let xlua_patch = XluaPatch::from_folder(&config.patch.path, config.launcher.edition) + .and_then(|patch| patch.is_applied(&game_path)); + + let xlua_patch = match xlua_patch { + Ok(patch) => patch, + Err(err) => { + // TODO: do we really need this toast message here? Perhaps it's not an error but a warning? + sender.input(AppMsg::Toast { + title: tr("patch-info-fetching-error"), + description: Some(err.to_string()) + }); + + tracing::error!("Failed to get xlua patch status: {err}. Used config value instead: {}", config.patch.apply_xlua); + + config.patch.apply_xlua + } + }; tracing::debug!("Patches status: player({player_patch}), xlua({xlua_patch})");