Skip to content

Commit

Permalink
foreach for readability
Browse files Browse the repository at this point in the history
  • Loading branch information
martinrrm committed Jul 17, 2023
1 parent f44d471 commit 9c390f5
Showing 1 changed file with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -507,13 +507,19 @@ await _logger.RunWithProgressAsync(
{
if (isRestoreSucceeded)
{
var errors = restoreSummaries.Any(summary => summary.Errors.Any(e => e.Code.Equals(NuGetLogCode.NU1901) || e.Code.Equals(NuGetLogCode.NU1902) || e.Code.Equals(NuGetLogCode.NU1903) || e.Code.Equals(NuGetLogCode.NU1904)));

if (errors)
foreach (RestoreSummary summary in restoreSummaries)
{
await _infoBarService.Value.ShowInfoBar(t);
foreach (IRestoreLogMessage error in summary.Errors)
{
if (error.Code.Equals(NuGetLogCode.NU1901) || error.Code.Equals(NuGetLogCode.NU1902) || error.Code.Equals(NuGetLogCode.NU1903) || error.Code.Equals(NuGetLogCode.NU1904))
{
await _infoBarService.Value.ShowInfoBar(t);
break;
}
}
}
if (!errors && _infoBarService.IsValueCreated)

if (_infoBarService.IsValueCreated) // if the InfoBar was created and no vulnerabilities found, hide it.
{
await _infoBarService.Value.HideInfoBar(t);
}
Expand Down

0 comments on commit 9c390f5

Please sign in to comment.