Skip to content

Commit c1de3ce

Browse files
Crystal Tennlrotschy
andcommitted
Add check for hasRepos on refresh
Co-authored-by: Crystal Tenn <ketchuponmyketchup@github.com> Co-authored-by: Liela Rotschy <lrotschy@github.com>
1 parent 4d5cae9 commit c1de3ce

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/treeViews/treeViews.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,12 @@ export async function initTreeViews(context: vscode.ExtensionContext, store: Run
2525
vscode.commands.registerCommand("github-actions.explorer.refresh", async () => {
2626
const canReachAPI = await canReachGitHubAPI();
2727
await vscode.commands.executeCommand("setContext", "github-actions.internet-access", canReachAPI);
28-
if (canReachAPI) {
28+
29+
const ghContext = await getGitHubContext();
30+
const hasGitHubRepos = ghContext && ghContext.repos.length > 0;
31+
await vscode.commands.executeCommand("setContext", "github-actions.has-repos", hasGitHubRepos);
32+
33+
if (canReachAPI && hasGitHubRepos) {
2934
await workflowTreeProvider.refresh();
3035
await settingsTreeProvider.refresh();
3136
}

0 commit comments

Comments
 (0)