Skip to content

Commit

Permalink
Fix prerender crash if getAppAccessToken fails
Browse files Browse the repository at this point in the history
This may happen the app isn't installed on laymonage/giscus (because it's self-hosted).
  • Loading branch information
laymonage committed Jun 5, 2021
1 parent e1fe86a commit 5e822a9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const getStaticProps = async () => {
const contents = readme.split('<!-- configuration -->');
contents[1] = `${contents[1]}\n## try it out 👇👇👇\n`;

const token = await getAppAccessToken('laymonage/giscus');
const token = await getAppAccessToken('laymonage/giscus').catch(() => '');
const [contentBefore, contentAfter] = await Promise.all(
contents.map(async (section) => await renderMarkdown(section, token, 'laymonage/giscus')),
);
Expand Down

1 comment on commit 5e822a9

@vercel
Copy link

@vercel vercel bot commented on 5e822a9 Jun 5, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.