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

Commit 349c7c1

Browse files
Fixes after merge
1 parent fe4d63b commit 349c7c1

File tree

2 files changed

+4
-19
lines changed

2 files changed

+4
-19
lines changed

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

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
using System.Linq;
2-
using System.Reactive;
1+
using System.Reactive;
32
using System.Reactive.Linq;
43
using GitHub.Models;
54
using GitHub.Services;
@@ -12,11 +11,6 @@ namespace GitHub.App.ViewModels.GitHubPane
1211
/// <inheritdoc cref="IPullRequestAnnotationItemViewModel"/>
1312
public class PullRequestAnnotationItemViewModel : ViewModelBase, IPullRequestAnnotationItemViewModel
1413
{
15-
readonly CheckSuiteModel checkSuite;
16-
readonly CheckRunModel checkRun;
17-
readonly IPullRequestSession session;
18-
readonly IPullRequestEditorService editorService;
19-
2014
bool isExpanded;
2115

2216
/// <summary>
@@ -25,22 +19,15 @@ public class PullRequestAnnotationItemViewModel : ViewModelBase, IPullRequestAnn
2519
/// <param name="annotation">The check run annotation model.</param>
2620
/// <param name="isFileInPullRequest">A flag that denotes if the annotation is part of the pull request's changes.</param>
2721
/// <param name="checkSuite">The check suite model.</param>
28-
/// <param name="checkRun">The check run model.</param>
29-
/// <param name="annotation">The check run annotation model.</param>
3022
/// <param name="session">The pull request session.</param>
3123
/// <param name="editorService">The pull request editor service.</param>
3224
public PullRequestAnnotationItemViewModel(
33-
CheckRunAnnotationModel annotation,
25+
CheckRunAnnotationModel annotation,
3426
bool isFileInPullRequest,
35-
CheckRunModel checkRun,
36-
CheckSuiteModel checkSuite,
27+
CheckSuiteModel checkSuite,
3728
IPullRequestSession session,
3829
IPullRequestEditorService editorService)
3930
{
40-
this.checkSuite = checkSuite;
41-
this.checkRun = checkRun;
42-
this.session = session;
43-
this.editorService = editorService;
4431
Annotation = annotation;
4532
IsFileInPullRequest = isFileInPullRequest;
4633

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,6 @@ void Load(PullRequestDetailModel pullRequest)
127127
CheckSuiteName = checkSuiteRun.checkSuite.ApplicationName;
128128
CheckRunName = checkSuiteRun.checkRun.Name;
129129

130-
// .Select(annotation => new PullRequestAnnotationItemViewModel(checkSuiteRun.checkSuite, checkSuiteRun.checkRun, annotation, session, pullRequestEditorService))
131-
132130
var changedFiles = new HashSet<string>(session.PullRequest.ChangedFiles.Select(model => model.FileName));
133131

134132
var annotationsLookup = checkSuiteRun.checkRun.Annotations
@@ -140,7 +138,7 @@ void Load(PullRequestDetailModel pullRequest)
140138
.ToDictionary(
141139
path => path,
142140
path => annotationsLookup[path]
143-
.Select(annotation => new PullRequestAnnotationItemViewModel(annotation, changedFiles.Contains(path)))
141+
.Select(annotation => new PullRequestAnnotationItemViewModel(annotation, changedFiles.Contains(path), checkSuiteRun.checkSuite, session, pullRequestEditorService))
144142
.Cast<IPullRequestAnnotationItemViewModel>()
145143
.ToArray()
146144
);

0 commit comments

Comments
 (0)