Skip to content

Commit

Permalink
install my packages fix (#14571)
Browse files Browse the repository at this point in the history
- fixed a bug where my package would not initiate an install
- attached RequestDownload handler
  • Loading branch information
dnenov authored Nov 7, 2023
1 parent ca4574d commit 33acd1b
Showing 1 changed file with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -647,12 +647,26 @@ private void PopulateMyPackages()
var pkgs = PackageManagerClientViewModel.CachedPackageList.Where(x => x.Maintainers != null && x.Maintainers.Contains(name)).ToList();
foreach(var pkg in pkgs)
{
myPackages.Add(new PackageManagerSearchElementViewModel(pkg, false));
var p = new PackageManagerSearchElementViewModel(pkg, false);
p.RequestDownload += this.PackageOnExecuted;

myPackages.Add(p);
}

SearchMyResults = new ObservableCollection<PackageManagerSearchElementViewModel>(myPackages);
}

private void ClearMySearchResults()
{
if (this.SearchMyResults == null) return;
foreach (var ele in this.SearchMyResults)
{
ele.RequestDownload -= PackageOnExecuted;
}

this.SearchMyResults = null;
}

/// <summary>
/// Sort the default package results in the view based on the sorting key and sorting direction.
/// </summary>
Expand Down Expand Up @@ -1116,7 +1130,6 @@ internal void ClearSearchResults()
{
ele.RequestDownload -= PackageOnExecuted;
}

this.SearchResults.Clear();
}

Expand Down Expand Up @@ -1570,6 +1583,8 @@ internal void Close()
InitialResultsLoaded = false; // reset the loading screen settings
RequestShowFileDialog -= OnRequestShowFileDialog;
nonHostFilter.ForEach(f => f.PropertyChanged -= filter_PropertyChanged);

ClearMySearchResults();
}
}
}

0 comments on commit 33acd1b

Please sign in to comment.