Skip to content

Commit

Permalink
fix: Fixed Downloading UI bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
HavenDV committed Jan 2, 2024
1 parent 7258e40 commit faf221b
Showing 1 changed file with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,23 @@ public void OnStateUpdate(InstallState state)

try
{
switch (state.InstallStatus())
var installStatus = state.InstallStatus();
switch (installStatus)
{
case InstallStatus.Unknown:
case InstallStatus.Pending:
case InstallStatus.Installing:
case InstallStatus.Installed:
case InstallStatus.Canceled:
break;

case InstallStatus.Downloading:
{
var bytesDownloaded = state.BytesDownloaded();
var totalBytesToDownload = state.TotalBytesToDownload() + 1;
var percents = Math.Round(
100.0 * state.BytesDownloaded() / state.TotalBytesToDownload());
100.0 * bytesDownloaded / totalBytesToDownload);

Handler.Options.DownloadingAction(context, percents);
break;
}
Expand Down

0 comments on commit faf221b

Please sign in to comment.