Skip to content

Commit

Permalink
fix: latest is also shown on different branches as main
Browse files Browse the repository at this point in the history
(cherry picked from commit bad4b4d)
  • Loading branch information
iadonkey committed Jul 24, 2024
1 parent 3a737fd commit 018ec8a
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 @@ -1238,7 +1238,7 @@ private async Task LoadNextPackageVersionsPageAsync(bool reset = false, Cancella
new PlcVersion
{
Version = null,
VersionDisplayText = "Latest"
VersionDisplayText = "Latest " + ( (branch == "main" || _packageItem.Package.Branches.Count == 1) && (results?.Item1.Any() == true) ? "(" + results.Item1.First().Version + ")" : "*")
}
};

Expand Down Expand Up @@ -1539,6 +1539,8 @@ private async void PackageFilter_SelectionChanged(object sender, SelectionChange
index = 0;
else if (index < 0 && _catalogItem?.Installed != null)
index = Versions.Count > 1 ? 1 : 0;
else if (index == 0 && _catalogItem?.Installed == null)
index = 1;

VersionsView.IsEnabled = true;
VersionsView.SelectedIndex = index;
Expand Down

0 comments on commit 018ec8a

Please sign in to comment.