Skip to content

Commit

Permalink
revert some after fixing lock
Browse files Browse the repository at this point in the history
  • Loading branch information
juliusmarminge committed May 10, 2024
1 parent b0e6dfe commit 8aa4267
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions upgrade/src/app/api/og/route.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,15 +103,15 @@ async function getFont<TWeights extends readonly number[]>({
";",
)}${text ? `&text=${encodeURIComponent(text)}` : ""}`;

const css = (await (
const css = await (
await fetch(API, {
headers: {
// Make sure it returns TTF.
"User-Agent":
"Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_8; de-at) AppleWebKit/533.21.1 (KHTML, like Gecko) Version/5.0.5 Safari/533.21.1",
},
})
).text()) as string;
).text();

const fonts = css
.split("@font-face {")
Expand Down
2 changes: 1 addition & 1 deletion upgrade/src/lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,5 +171,5 @@ export const getDiffFromGithub = async (props: DiffLocation) => {
throw new Error("Failed to download diff");
}

return response.text() as Promise<string>;
return response.text();
};
2 changes: 1 addition & 1 deletion www/src/utils/fetchGithub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export const fetchGithub = async <T extends "commits" | "repo">(
},
});

const data = (await res.json()) as unknown;
const data = await res.json();

if (!res.ok) {
const msg = `Request to fetch ${url} failed. Reason: ${res.statusText}
Expand Down
4 changes: 2 additions & 2 deletions www/src/utils/ogFont.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ export async function getFont<TWeights extends readonly number[]>({
";",
)}${text ? `&text=${encodeURIComponent(text)}` : ""}`;

const css = (await (
const css = await (
await fetch(API, {
headers: {
// Make sure it returns TTF.
"User-Agent":
"Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_8; de-at) AppleWebKit/533.21.1 (KHTML, like Gecko) Version/5.0.5 Safari/533.21.1",
},
})
).text()) as string;
).text();

const fonts = css
.split("@font-face {")
Expand Down

0 comments on commit 8aa4267

Please sign in to comment.