Skip to content

Commit

Permalink
🐛 Fix graphs base URL broken in #52
Browse files Browse the repository at this point in the history
  • Loading branch information
AnandChowdhary committed Nov 17, 2020
1 parent d9364b2 commit b7806cd
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/components/LiveStatus.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@
const octokit = createOctokit();
const owner = config.owner;
const repo = config.repo;
const { apiBaseUrl } = config["status-website"];
let { apiBaseUrl } = config["status-website"] || {};
let sites = [];
const isGitHubApi = (apiBaseUrl || "").includes("api.github.com");
const userContentBaseUrl = isGitHubApi ? `https://github.com/raw` : apiBaseUrl;
if (!apiBaseUrl) apiBaseUrl = "https://api.github.com";
const userContentBaseUrl = apiBaseUrl.includes("api.github.com")
? `https://github.com/raw`
: apiBaseUrl;
const graphsBaseUrl = `${userContentBaseUrl}/${owner}/${repo}/master/graphs`;
onMount(async () => {
Expand Down

0 comments on commit b7806cd

Please sign in to comment.