pi: correctly clear highlighted categories when clearing the search bar

This commit is contained in:
goat 2024-06-19 22:48:38 +02:00
parent a8025298ea
commit 79392230c4
2 changed files with 3 additions and 1 deletions

View file

@ -373,6 +373,8 @@ internal class PluginCategoryManager
/// <param name="plugins">List of plugins whose categories should be highlighted.</param>
public void SetCategoryHighlightsForPlugins(IEnumerable<PluginManifest> plugins)
{
ArgumentNullException.ThrowIfNull(plugins);
this.highlightedCategoryKinds.Clear();
foreach (var entry in plugins)

View file

@ -3573,7 +3573,7 @@ internal class PluginInstallerWindow : Window, IDisposable
{
if (string.IsNullOrEmpty(this.searchText))
{
this.categoryManager.SetCategoryHighlightsForPlugins(null);
this.categoryManager.SetCategoryHighlightsForPlugins(Array.Empty<RemotePluginManifest>());
// Reset here for good measure, as we're returning from a search
this.openPluginCollapsibles.Clear();