mirror of
https://github.com/an-anime-team/an-anime-game-launcher.git
synced 2024-11-21 20:36:01 +03:00
fix(ui): fixed repairer's NaN progress
This commit is contained in:
parent
85fd0aed14
commit
5557c31895
1 changed files with 4 additions and 4 deletions
|
@ -98,14 +98,14 @@ pub fn repair_game(sender: ComponentSender<App>, progress_bar_input: Sender<Prog
|
|||
}
|
||||
|
||||
if !broken.is_empty() {
|
||||
let total = broken.len() as u64;
|
||||
|
||||
progress_bar_input.send(ProgressBarMsg::UpdateCaption(Some(tr("repairing-files"))));
|
||||
progress_bar_input.send(ProgressBarMsg::DisplayFraction(false));
|
||||
progress_bar_input.send(ProgressBarMsg::UpdateProgress(0, 0));
|
||||
progress_bar_input.send(ProgressBarMsg::UpdateProgress(0, total));
|
||||
|
||||
tracing::warn!("Found broken files:\n{}", broken.iter().fold(String::new(), |acc, file| acc + &format!("- {}\n", file.path.to_string_lossy())));
|
||||
|
||||
let total = broken.len() as f64;
|
||||
|
||||
// Get main patch status
|
||||
|
||||
let player_patch = UnityPlayerPatch::from_folder(&config.patch.path, config.launcher.edition)
|
||||
|
@ -175,7 +175,7 @@ pub fn repair_game(sender: ComponentSender<App>, progress_bar_input: Sender<Prog
|
|||
tracing::debug!("Skipped file: {}", file.path.to_string_lossy());
|
||||
}
|
||||
|
||||
progress_bar_input.send(ProgressBarMsg::UpdateProgress(i as u64, total as u64));
|
||||
progress_bar_input.send(ProgressBarMsg::UpdateProgress(i as u64 + 1, total));
|
||||
}
|
||||
|
||||
progress_bar_input.send(ProgressBarMsg::DisplayFraction(true));
|
||||
|
|
Loading…
Reference in a new issue