From c040a75806f73562ab625d33d53e7a7cbb5d4d8a Mon Sep 17 00:00:00 2001 From: Orta Therox Date: Sat, 7 Oct 2017 11:19:18 -0400 Subject: [PATCH] Removes the custom viewport if you are not in a GitHub repo --- package.json | 3 ++- src/github-issues-prs.ts | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index a13dbf5..8e6513c 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,8 @@ "explorer": [ { "id": "githubIssuesPrs", - "name": "GitHub Issues and PRs" + "name": "GitHub Issues and PRs", + "when": "is-running-a-github-repo" } ] }, diff --git a/src/github-issues-prs.ts b/src/github-issues-prs.ts index a77718a..dc73323 100644 --- a/src/github-issues-prs.ts +++ b/src/github-issues-prs.ts @@ -183,6 +183,8 @@ export class GitHubIssuesPrsProvider implements TreeDataProvider { const remotes = await this.getGitHubRemotes(); if (!remotes.length) { return [new TreeItem('No GitHub repositories found')]; + } else { + commands.executeCommand('setContext', 'is-running-a-github-repo', true); } let assignee: string | undefined;