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

Commit 92fb304

Browse files
Importing ITeamExplorerContext
1 parent 62b71c2 commit 92fb304

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

src/GitHub.App/Services/IssuesAutoCompleteSource.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,22 @@ namespace GitHub.Services
1616
[PartCreationPolicy(CreationPolicy.Shared)]
1717
public class IssuesAutoCompleteSource : IAutoCompleteSource
1818
{
19-
readonly LocalRepositoryModel localRepositoryModel;
19+
readonly ITeamExplorerContext teamExplorerContext;
2020
readonly IGraphQLClientFactory graphqlFactory;
2121

2222
[ImportingConstructor]
23-
public IssuesAutoCompleteSource(LocalRepositoryModel localRepositoryModel, IGraphQLClientFactory graphqlFactory)
23+
public IssuesAutoCompleteSource(ITeamExplorerContext teamExplorerContext, IGraphQLClientFactory graphqlFactory)
2424
{
25-
Guard.ArgumentNotNull(localRepositoryModel, nameof(localRepositoryModel));
25+
Guard.ArgumentNotNull(teamExplorerContext, nameof(teamExplorerContext));
2626
Guard.ArgumentNotNull(graphqlFactory, nameof(graphqlFactory));
2727

28-
this.localRepositoryModel = localRepositoryModel;
28+
this.teamExplorerContext = teamExplorerContext;
2929
this.graphqlFactory = graphqlFactory;
3030
}
3131

3232
public IObservable<AutoCompleteSuggestion> GetSuggestions()
3333
{
34+
var localRepositoryModel = teamExplorerContext.ActiveRepository;
3435
var query = new Query().Repository(owner: localRepositoryModel.Owner, name: localRepositoryModel.Name)
3536
.Select(repository =>
3637
repository.Issues(null, null, null, null, null, null, null)

src/GitHub.App/Services/MentionsAutoCompleteSource.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,26 +20,27 @@ namespace GitHub.Services
2020
[PartCreationPolicy(CreationPolicy.Shared)]
2121
public class MentionsAutoCompleteSource : IAutoCompleteSource
2222
{
23-
readonly LocalRepositoryModel localRepositoryModel;
23+
readonly ITeamExplorerContext teamExplorerContext;
2424
readonly IGraphQLClientFactory graphqlFactory;
2525
readonly IAvatarProvider avatarProvider;
2626

2727
[ImportingConstructor]
28-
public MentionsAutoCompleteSource(LocalRepositoryModel localRepositoryModel,
28+
public MentionsAutoCompleteSource(ITeamExplorerContext teamExplorerContext,
2929
IGraphQLClientFactory graphqlFactory,
3030
IAvatarProvider avatarProvider)
3131
{
32-
Guard.ArgumentNotNull(localRepositoryModel, nameof(localRepositoryModel));
32+
Guard.ArgumentNotNull(teamExplorerContext, nameof(teamExplorerContext));
3333
Guard.ArgumentNotNull(graphqlFactory, nameof(graphqlFactory));
3434
Guard.ArgumentNotNull(avatarProvider, nameof(avatarProvider));
3535

36-
this.localRepositoryModel = localRepositoryModel;
36+
this.teamExplorerContext = teamExplorerContext;
3737
this.graphqlFactory = graphqlFactory;
3838
this.avatarProvider = avatarProvider;
3939
}
4040

4141
public IObservable<AutoCompleteSuggestion> GetSuggestions()
4242
{
43+
var localRepositoryModel = teamExplorerContext.ActiveRepository;
4344
var query = new Query().Repository(owner: localRepositoryModel.Owner, name: localRepositoryModel.Name)
4445
.Select(repository =>
4546
repository.MentionableUsers(null, null, null, null)

0 commit comments

Comments
 (0)