Skip to content

Commit 11d0086

Browse files
committed
fixing undefined var prop
1 parent 9436137 commit 11d0086

File tree

2 files changed

+19
-24
lines changed

2 files changed

+19
-24
lines changed

src/routes/+error.svelte

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,27 +16,26 @@
1616
1717
onMount(async () => {
1818
// only for genuine 500s on a top-level slug
19-
if ($page.status === 500) {
20-
const parts = $page.url.pathname.split('/').filter(Boolean);
21-
const repo = parts[0];
22-
23-
if (repo) {
24-
fetchRepoDetails(config.githubUser, $page.params.repo, fetch)
25-
.then((res) => {
26-
if (res && res?.id) {
27-
data.repoDetails = res as Project;
28-
data.meta = findRepoMeta(repo, config.projects) || {};
29-
console.log(data.repoDetails)
30-
if (data.repoDetails.has_pages) {
31-
gitHubPagesUrl = `https://${config.githubUser}.github.io/${repo}/`;
32-
}
19+
20+
const parts = $page.url.pathname.split('/').filter(Boolean);
21+
const repo = parts[0];
22+
if (repo) {
23+
fetchRepoDetails(config.githubUser, repo, fetch)
24+
.then((res) => {
25+
if (res && res?.id) {
26+
data.repoDetails = res as Project;
27+
data.meta = findRepoMeta(repo, config.projects) || {};
28+
console.log(data.repoDetails)
29+
if (data.repoDetails.has_pages) {
30+
gitHubPagesUrl = `https://${config.githubUser}.github.io/${repo}/`;
3331
}
34-
})
35-
.catch((err) => {
36-
console.error('Error fetching repo details', err);
37-
});
38-
}
32+
}
33+
})
34+
.catch((err) => {
35+
console.error('Error fetching repo details', err);
36+
});
3937
}
38+
4039
});
4140
</script>
4241

svelte.config.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,8 @@ async function getGithubSlugs() {
2323

2424
const githubSlugs = await getGithubSlugs();
2525

26-
console.log(githubSlugs)
27-
28-
2926
if (isStatic && githubSlugs.length === 0) {
30-
console.log('ffs')
31-
// throw new Error('⚠️ No GitHub slugs found. Ensure GITHUB_TOKEN is set and has access to public repos.');
27+
throw new Error('⚠️ No GitHub slugs found. Ensure GITHUB_TOKEN is set and has access to public repos.');
3228
}
3329

3430
/** @type {import('@sveltejs/kit').Config} */

0 commit comments

Comments
 (0)