From b7806cdb2a98233a4d9853de3d09fb4ab1db82c7 Mon Sep 17 00:00:00 2001 From: Anand Chowdhary Date: Wed, 18 Nov 2020 00:10:20 +0530 Subject: [PATCH] :bug: Fix graphs base URL broken in #52 --- src/components/LiveStatus.svelte | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/components/LiveStatus.svelte b/src/components/LiveStatus.svelte index c7629e7..7acf417 100644 --- a/src/components/LiveStatus.svelte +++ b/src/components/LiveStatus.svelte @@ -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 () => {