Skip to content

Commit

Permalink
fix: add packages to catalog that exist, but not in the requested ver…
Browse files Browse the repository at this point in the history
…sion
  • Loading branch information
iadonkey authored Dec 21, 2023
1 parent e12378f commit 5ffec26
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion TwinpackVsixShared/Dialogs/CatalogWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1257,6 +1257,7 @@ private async Task LoadInstalledPackagesAsync(CancellationToken cancellationToke

if (_plcConfig != null)
{
_installedPackages.RemoveAll(x => x.PackageId == null);
foreach (var item in _plcConfig.Packages)
{
CatalogItem catalogItem = new CatalogItem(item);
Expand All @@ -1277,7 +1278,8 @@ private async Task LoadInstalledPackagesAsync(CancellationToken cancellationToke
catalogItem.Update = packageVersionLatest;
}

if (!_installedPackages.Any(x => x.PackageId == catalogItem.PackageId))
var packageId = catalogItem.PackageId ?? packageVersionLatest.PackageId;
if (packageId == null || !_installedPackages.Any(x => x.PackageId == packageId))
{
_installedPackages.Add(catalogItem);
}
Expand Down

0 comments on commit 5ffec26

Please sign in to comment.