Skip to content

Commit 451b41e

Browse files
committed
Update function name
1 parent b5f88a4 commit 451b41e

5 files changed

Lines changed: 14 additions & 14 deletions

File tree

src/git/repository.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {getRemoteName} from "../configuration/configuration";
66
import {Protocol} from "../external/protocol";
77
import {logDebug, logError} from "../log";
88
import {API, GitExtension, RefType, RepositoryState} from "../typings/git";
9-
import {hasInternetConnectivity as canReachGitHubAPI} from "../util";
9+
import {canReachGitHubAPI} from "../util";
1010

1111
interface GitHubUrls {
1212
workspaceUri: vscode.Uri;

src/treeViews/currentBranch.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@ import * as vscode from "vscode";
33
import {getCurrentBranch, getGitHubContext, GitHubRepoContext} from "../git/repository";
44
import {CurrentBranchRepoNode} from "./current-branch/currentBranchRepoNode";
55

6+
import {NoRunForBranchNode} from "./current-branch/noRunForBranchNode";
67
import {log, logDebug} from "../log";
78
import {RunStore} from "../store/store";
89
import {AttemptNode} from "./shared/attemptNode";
10+
import {NoInternetConnectivityNode} from "./shared/noInternetConnectivityNode";
11+
import {NoWorkflowJobsNode} from "./shared/noWorkflowJobsNode";
912
import {PreviousAttemptsNode} from "./shared/previousAttemptsNode";
1013
import {WorkflowJobNode} from "./shared/workflowJobNode";
1114
import {WorkflowRunNode} from "./shared/workflowRunNode";
1215
import {WorkflowRunTreeDataProvider} from "./workflowRunTreeDataProvider";
13-
import {NoInternetConnectivityNode} from "./shared/noInternetConnectivityNode";
14-
import {hasInternetConnectivity} from "../util";
15-
import {NoRunForBranchNode} from "./current-branch/noRunForBranchNode";
16-
import {NoWorkflowJobsNode} from "./shared/noWorkflowJobsNode";
1716
import {WorkflowStepNode} from "./workflows/workflowStepNode";
17+
import {canReachGitHubAPI} from "../util";
1818

1919
type CurrentBranchTreeNode =
2020
| CurrentBranchRepoNode
@@ -43,8 +43,8 @@ export class CurrentBranchTreeProvider
4343
}
4444

4545
async refresh(): Promise<void> {
46-
// Don't delete all the nodes if we don't have internet connectivity
47-
if (await hasInternetConnectivity()) {
46+
// Don't delete all the nodes if we can't reach GitHub API
47+
if (await canReachGitHubAPI()) {
4848
this._onDidChangeTreeData.fire(null);
4949
} else {
5050
await vscode.window.showWarningMessage("Unable to refresh, could not reach GitHub API");

src/treeViews/settings.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ import {EnvironmentVariablesNode} from "./settings/environmentVariablesNode";
1515
import {OrgVariablesNode} from "./settings/orgVariablesNode";
1616
import {OrgSecretsNode} from "./settings/orgSecretsNode";
1717
import {NoInternetConnectivityNode} from "./shared/noInternetConnectivityNode";
18-
import {hasInternetConnectivity} from "../util";
18+
import {canReachGitHubAPI} from "../util";
1919

2020
export class SettingsTreeProvider implements vscode.TreeDataProvider<SettingsExplorerNode> {
2121
private _onDidChangeTreeData = new vscode.EventEmitter<SettingsExplorerNode | null>();
2222
readonly onDidChangeTreeData = this._onDidChangeTreeData.event;
2323

2424
async refresh(): Promise<void> {
25-
// Don't delete all the nodes if we don't have internet connectivity
26-
if (await hasInternetConnectivity()) {
25+
// Don't delete all the nodes if we can't reach GitHub API
26+
if (await canReachGitHubAPI()) {
2727
this._onDidChangeTreeData.fire(null);
2828
} else {
2929
await vscode.window.showWarningMessage("Unable to refresh, could not reach GitHub API");

src/treeViews/workflows.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import {WorkflowRunTreeDataProvider} from "./workflowRunTreeDataProvider";
1616
import {WorkflowNode} from "./workflows/workflowNode";
1717
import {getWorkflowNodes, WorkflowsRepoNode} from "./workflows/workflowsRepoNode";
1818
import {WorkflowStepNode} from "./workflows/workflowStepNode";
19-
import {hasInternetConnectivity} from "../util";
19+
import {canReachGitHubAPI} from "../util";
2020

2121
type WorkflowsTreeNode =
2222
| AuthenticationNode
@@ -46,8 +46,8 @@ export class WorkflowsTreeProvider
4646
}
4747

4848
async refresh(): Promise<void> {
49-
// Don't delete all the nodes if we don't have internet connectivity
50-
if (await hasInternetConnectivity()) {
49+
// Don't delete all the nodes if we can't reach GitHub API
50+
if (await canReachGitHubAPI()) {
5151
this._onDidChangeTreeData.fire(null);
5252
} else {
5353
await vscode.window.showWarningMessage("Unable to refresh, could not reach GitHub API");

src/util.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import {Octokit} from "@octokit/rest";
22

33
import {logError} from "./log";
44

5-
export async function hasInternetConnectivity() {
5+
export async function canReachGitHubAPI() {
66
try {
77
const octokit = new Octokit();
88
await octokit.request("GET /", {

0 commit comments

Comments
 (0)