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

Commit 06acfca

Browse files
author
Jasmine
committed
wait for 250 miliseconds, return result based on if task is done
1 parent 8a91de0 commit 06acfca

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

src/GitHub.VisualStudio/Menus/CopyLink.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,7 @@ public async void Activate([AllowNull]object data = null)
4848
public bool CanShow()
4949
{
5050
Task<bool> githubRepoCheckTask = IsGitHubRepo();
51-
githubRepoCheckTask.Wait(250);
52-
return githubRepoCheckTask.Result;
51+
return githubRepoCheckTask.Wait(250) ? githubRepoCheckTask.Result : false;
5352
}
5453

5554
}

src/GitHub.VisualStudio/Menus/OpenLink.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ public async void Activate([AllowNull]object data = null)
3737
public bool CanShow()
3838
{
3939
Task<bool> githubRepoCheckTask = IsGitHubRepo();
40-
githubRepoCheckTask.Wait(250);
41-
return githubRepoCheckTask.Result;
40+
return githubRepoCheckTask.Wait(250) ? githubRepoCheckTask.Result : false;
4241
}
4342
}
4443
}

0 commit comments

Comments
 (0)