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

Commit d86fad5

Browse files
jcansdaleStanleyGoldman
authored andcommitted
Use local not global ServiceProvider
1 parent d4603a2 commit d86fad5

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/GitHub.VisualStudio.16/Sync/PublishSection.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public override void Initialize(object sender, SectionInitializeEventArgs e)
8585

8686
async Task DoPublishToGitHub()
8787
{
88-
var componentModel = await Microsoft.VisualStudio.Shell.ServiceProvider.GetGlobalServiceAsync<SComponentModel, IComponentModel>();
88+
var componentModel = ServiceProvider.GetService(typeof(SComponentModel)) as IComponentModel;
8989
ShowPublishDialog(componentModel);
9090
}
9191

@@ -108,8 +108,7 @@ void ShowPublishDialog(IComponentModel componentModel)
108108
.Where(x => x == ProgressState.Success)
109109
.Subscribe(_ =>
110110
{
111-
var teamExplorer =
112-
VisualStudio.Shell.ServiceProvider.GlobalProvider.GetService(typeof(ITeamExplorer)) as ITeamExplorer;
111+
var teamExplorer = ServiceProvider.GetService(typeof(ITeamExplorer)) as ITeamExplorer;
113112
teamExplorer?.NavigateToPage(new Guid(TeamExplorerPageIds.Home), null);
114113

115114
// HandleCreatedRepo(ActiveRepo);

0 commit comments

Comments
 (0)