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

Commit f12ab09

Browse files
committed
Remove FindContextFromBrowser from hidden command
The `GitHub.OpenFromUrl` command isn't exposed on the UI but still shouldn't be calling FindContextFromBrowser .
1 parent f651b19 commit f12ab09

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/GitHub.VisualStudio/Commands/OpenFromUrlCommand.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,16 +60,15 @@ public OpenFromUrlCommand(
6060

6161
public override async Task Execute(string url)
6262
{
63-
if (string.IsNullOrEmpty(url))
63+
var context = string.IsNullOrEmpty(url) ? null : gitHubContextService.Value.FindContextFromUrl(url);
64+
if (context == null)
6465
{
65-
url = Clipboard.GetText(TextDataFormat.Text);
66+
context = gitHubContextService.Value.FindContextFromClipboard();
6667
}
6768

68-
var context = gitHubContextService.Value.FindContextFromUrl(url);
69-
context = context ?? gitHubContextService.Value.FindContextFromBrowser();
70-
7169
if (context == null)
7270
{
71+
// Couldn't find a URL to open
7372
return;
7473
}
7574

0 commit comments

Comments
 (0)