From a5ebf08a8c9587fa6bd76c3eac41e6459854d06a Mon Sep 17 00:00:00 2001 From: Glavo Date: Tue, 8 Feb 2022 12:23:32 +0800 Subject: [PATCH] Reduce refresh UI controls --- HMCLauncher/HMCL/java-download.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/HMCLauncher/HMCL/java-download.ps1 b/HMCLauncher/HMCL/java-download.ps1 index 859c40e50..736c3a088 100644 --- a/HMCLauncher/HMCL/java-download.ps1 +++ b/HMCLauncher/HMCL/java-download.ps1 @@ -171,12 +171,12 @@ $form.Controls.Add($layout) $progressBar.Value = [int][System.Math]::Truncate($percentage) $label.Text = [string]::Format("{0:0.00}%", $percentage) - $label.Refresh() } [System.ComponentModel.AsyncCompletedEventHandler]$downloadFileCompletedEventHandler = { param($sender, [System.ComponentModel.AsyncCompletedEventArgs]$CompletedEventArgs) if (!$form.IsDisposed) { + $label.Refresh() if ($CompletedEventArgs.Cancelled) { $form.DialogResult = [System.Windows.Forms.DialogResult]::Cancel } elseif ($CompletedEventArgs.Error -ne $null) {