Skip to content

Commit

Permalink
Address PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
jebriede committed Jul 29, 2022
1 parent c03fc79 commit e9ffc67
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -934,7 +934,7 @@ private async ValueTask RefreshInstalledAndUpdatesTabsAsync()
Interlocked.Exchange(ref _refreshCts, refreshCts)?.Cancel();

// Update installed tab warning icon
(int vulnerablePackages, int deprecatedPackages) = await GetInstalledVulnerableAndDeprecatedPackagesCountAsync(loadContext, refreshCts.Token);
(int vulnerablePackages, int deprecatedPackages) = await GetInstalledVulnerableAndDeprecatedPackagesCountAsync(loadContext, SelectedSource.PackageSources, refreshCts.Token);
_topPanel.UpdateWarningStatusOnInstalledTab(vulnerablePackages, deprecatedPackages);

// Update updates tab count
Expand All @@ -948,11 +948,8 @@ private async ValueTask RefreshInstalledAndUpdatesTabsAsync()
_topPanel.UpdateCountOnUpdatesTab(Model.CachedUpdates.Packages.Count);
}

private async Task<(int, int)> GetInstalledVulnerableAndDeprecatedPackagesCountAsync(PackageLoadContext loadContext, CancellationToken token)
private async Task<(int, int)> GetInstalledVulnerableAndDeprecatedPackagesCountAsync(PackageLoadContext loadContext, IReadOnlyCollection<PackageSourceContextInfo> packageSources, CancellationToken token)
{
await NuGetUIThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();
IReadOnlyCollection<PackageSourceContextInfo> packageSources = SelectedSource.PackageSources;

// Switch off the UI thread before fetching installed packages and deprecation metadata.
await TaskScheduler.Default;

Expand Down

0 comments on commit e9ffc67

Please sign in to comment.