Skip to content

Commit b3c196a

Browse files
have to use the right api on enterprise urls
1 parent 07af7cd commit b3c196a

File tree

2 files changed

+31
-2
lines changed

2 files changed

+31
-2
lines changed

package-lock.json

+26
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/content.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ const getCurrentUser = () => $(".js-menu-target img").attr("alt").slice(1) || ""
88
const isPrivate = () => $(".label-private").length > 0;
99
let statsScope = "repo";
1010

11+
const githubURLBase = window.location.hostname === 'github.com' ? 'api.github.com' : `${window.location.hostname}/api/v3`;
12+
const githubURL = `https://${githubURLBase}`
13+
1114
function getContributor() {
1215
let $contributor = $(".timeline-comment-wrapper .timeline-comment-header-text strong a");
1316
if ($contributor.length) {
@@ -71,10 +74,10 @@ function contributorCount({access_token, contributor, user, repoPath, old = {},
7174
repo = undefined;
7275
repoPath = "__self";
7376
}
74-
77+
7578
let searchURL = buildUrl({
7679
access_token,
77-
base: "https://api.github.com/search/issues",
80+
base: `${githubURL}/search/issues`,
7881
order: "asc",
7982
per_page: "1",
8083
q: {

0 commit comments

Comments
 (0)