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

Commit ea07d4f

Browse files
authored
Merge pull request #982 from github/fixes/971-show-docs-in-github-repo-only
Show docs in GitHub repo only
2 parents a3803a6 + 4c29788 commit ea07d4f

File tree

1 file changed

+14
-20
lines changed

1 file changed

+14
-20
lines changed

src/GitHub.TeamFoundation.14/Home/GitHubHomeSection.cs

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ public class GitHubHomeSection : TeamExplorerSectionBase, IGitHubHomeSection
2626
{
2727
public const string GitHubHomeSectionId = "72008232-2104-4FA0-A189-61B0C6F91198";
2828
const string TrainingUrl = "https://services.github.com/on-demand/windows/visual-studio";
29+
readonly static Guid welcomeMessageGuid = new Guid(Guids.TeamExplorerWelcomeMessage);
2930

3031
readonly IVisualStudioBrowser visualStudioBrowser;
3132
readonly ITeamExplorerServices teamExplorerServices;
@@ -53,25 +54,6 @@ public GitHubHomeSection(IGitHubServiceProvider serviceProvider,
5354
var openOnGitHub = ReactiveCommand.Create();
5455
openOnGitHub.Subscribe(_ => DoOpenOnGitHub());
5556
OpenOnGitHub = openOnGitHub;
56-
57-
// We want to display a welcome message but only if Team Explorer isn't
58-
// already displaying the "Install 3rd Party Tools" message. To do this
59-
// we need to set a timer and check in the tick as at this point the message
60-
// won't be initialized.
61-
if (!settings.HideTeamExplorerWelcomeMessage)
62-
{
63-
var timer = new DispatcherTimer();
64-
timer.Interval = new TimeSpan(10);
65-
timer.Tick += (s, e) =>
66-
{
67-
timer.Stop();
68-
if (!IsGitToolsMessageVisible())
69-
{
70-
ShowWelcomeMessage();
71-
}
72-
};
73-
timer.Start();
74-
}
7557
}
7658

7759
bool IsGitToolsMessageVisible()
@@ -93,12 +75,24 @@ protected async override void RepoChanged(bool changed)
9375
RepoName = ActiveRepoName;
9476
RepoUrl = ActiveRepoUri.ToString();
9577
Icon = GetIcon(false, true, false);
78+
79+
// We want to display a welcome message but only if Team Explorer isn't
80+
// already displaying the "Install 3rd Party Tools" message and the current repo is hosted on GitHub.
81+
if (!settings.HideTeamExplorerWelcomeMessage && !IsGitToolsMessageVisible())
82+
{
83+
ShowWelcomeMessage();
84+
}
85+
9686
Debug.Assert(SimpleApiClient != null,
9787
"If we're in this block, simpleApiClient cannot be null. It was created by UpdateStatus");
9888
var repo = await SimpleApiClient.GetRepository();
9989
Icon = GetIcon(repo.Private, true, repo.Fork);
10090
IsLoggedIn = IsUserAuthenticated();
10191
}
92+
else
93+
{
94+
teamExplorerServices.HideNotification(welcomeMessageGuid);
95+
}
10296
}
10397

10498
public override async void Refresh()
@@ -108,6 +102,7 @@ public override async void Refresh()
108102
{
109103
IsLoggedIn = IsUserAuthenticated();
110104
}
105+
111106
base.Refresh();
112107
}
113108

@@ -149,7 +144,6 @@ void DoOpenOnGitHub()
149144

150145
void ShowWelcomeMessage()
151146
{
152-
var welcomeMessageGuid = new Guid(Guids.TeamExplorerWelcomeMessage);
153147
teamExplorerServices.ShowMessage(
154148
Resources.TeamExplorerWelcomeMessage,
155149
new RelayCommand(o =>

0 commit comments

Comments
 (0)