Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit 94fc76b

Browse files
Using the count instead
1 parent eaef6c6 commit 94fc76b

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/GitHub.App/ViewModels/GitHubPane/PullRequestDetailViewModel.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public sealed class PullRequestDetailViewModel : PanePageViewModelBase, IPullReq
5757
bool refreshOnActivate;
5858
Uri webUrl;
5959
IDisposable sessionSubscription;
60-
IReadOnlyList<IPullRequestCheckViewModel> checks;
60+
IReadOnlyList<IPullRequestCheckViewModel> checks = Array.Empty<IPullRequestCheckViewModel>();
6161

6262
/// <summary>
6363
/// Initializes a new instance of the <see cref="PullRequestDetailViewModel"/> class.
@@ -350,7 +350,7 @@ public async Task Load(PullRequestDetailModel pullRequest)
350350
Body = !string.IsNullOrWhiteSpace(pullRequest.Body) ? pullRequest.Body : Resources.NoDescriptionProvidedMarkdown;
351351
Reviews = PullRequestReviewSummaryViewModel.BuildByUser(Session.User, pullRequest).ToList();
352352

353-
Checks = PullRequestCheckViewModel.Build(viewViewModelFactory, pullRequest)?.ToList();
353+
Checks = (IReadOnlyList<IPullRequestCheckViewModel>) PullRequestCheckViewModel.Build(viewViewModelFactory, pullRequest)?.ToList() ?? Array.Empty<IPullRequestCheckViewModel>();
354354

355355
await Files.InitializeAsync(Session);
356356

src/GitHub.VisualStudio.UI/Views/GitHubPane/PullRequestDetailView.xaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,8 @@
248248
HeaderText="Checks"
249249
IsExpanded="True"
250250
Margin="0 8 0 0"
251-
ghfvs:ScrollingVerticalStackPanel.IsFixed="true">
251+
ghfvs:ScrollingVerticalStackPanel.IsFixed="true"
252+
Visibility="{Binding Checks.Count, Converter={ghfvs:CountToVisibilityConverter}}">
252253
<ItemsControl ItemsSource="{Binding Checks}" Margin="0 4 12 4">
253254
<ItemsControl.ItemsPanel>
254255
<ItemsPanelTemplate>

0 commit comments

Comments
 (0)