Skip to content

Commit

Permalink
reduce variable count
Browse files Browse the repository at this point in the history
  • Loading branch information
aspriddell committed May 15, 2023
1 parent e3ac7dc commit 2b4f612
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions DragonFruit.Kaplan/ViewModels/PackageRemovalTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,10 @@ private DeploymentProgress? Progress

public async Task RemoveAsync(CancellationToken cancellation = default)
{
var progressCallback = new Progress<DeploymentProgress>(p => Progress = p);
var options = _mode == PackageInstallationMode.Machine ? RemovalOptions.RemoveForAllUsers : RemovalOptions.None;
var currentRemovalTask = _manager.RemovePackageAsync(Package.Package.Id.FullName, options);

var progressCallback = new Progress<DeploymentProgress>(p => Progress = p);
await currentRemovalTask.AsTask(cancellation, progressCallback).ConfigureAwait(false);
await _manager.RemovePackageAsync(Package.Package.Id.FullName, options).AsTask(cancellation, progressCallback).ConfigureAwait(false);
}
}
}

0 comments on commit 2b4f612

Please sign in to comment.