Skip to content

Commit

Permalink
Attempt to fix more build errors
Browse files Browse the repository at this point in the history
  • Loading branch information
xzippyzachx committed Apr 18, 2024
1 parent a59dff7 commit 54aa2d8
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 12 deletions.
2 changes: 2 additions & 0 deletions src/app.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
%sveltekit.head%

<base href="%sveltekit.assets%" />
</head>
<body data-sveltekit-preload-data="hover">
<div style="display: contents">%sveltekit.body%</div>
Expand Down
41 changes: 29 additions & 12 deletions src/routes/projects.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,37 @@
const preview_count = 7
onMount(async () => {
const response = await fetch("/api/jam-games");
let jamGames = (await response.json()).data;
let jamGames = []
try {
const response = await fetch(`/api/jam-games`, {
method: 'GET',
headers: {
'Accept': 'application/json'
}
})
const responseText = await response.text()
if (responseText == "Not found")
{
return
}
jamGames = JSON.parse(responseText).data
}
catch (error)
{
console.log(error)
}
jamGames.forEach((game) => {
clubProjects.push({
name: game.game.title,
author: game.game.user.name,
url: game.game.url,
image: game.game.cover,
});
});
jamGames.forEach((game) => {
clubProjects.push({
name: game.game.title,
author: game.game.user.name,
url: game.game.url,
image: game.game.cover,
});
});
clubProjects = clubProjects;
clubProjects = clubProjects.slice(0,7)
clubProjects = clubProjects
clubProjects = clubProjects.slice(0,7)
});
</script>

Expand Down
4 changes: 4 additions & 0 deletions src/routes/projects/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
}
})
const responseText = await response.text()
if (responseText == "Not found")
{
return
}
jamGames = JSON.parse(responseText).data
}
catch (error)
Expand Down
6 changes: 6 additions & 0 deletions src/routes/zine/+page.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ export const load = async ({ fetch }) => {
}
})
const responseText = await response.text()
if (responseText == "Not found")
{
return {
posts
}
}
posts = JSON.parse(responseText)
}
catch (error)
Expand Down

0 comments on commit 54aa2d8

Please sign in to comment.