Skip to content

Commit

Permalink
Fix data being object
Browse files Browse the repository at this point in the history
Signed-off-by: Ayase Minori <[email protected]>
  • Loading branch information
sr229 committed Apr 18, 2024
1 parent dd8da44 commit 7165501
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pages/about.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ export const getStaticProps: GetStaticProps = async ({ locale }) => {

const data = await client.get(`contribs`)

const parsed: cache = JSON.parse(data as string)
const parsed: cache = JSON.parse(JSON.stringify(data))

const ocData = await fetch(`https://api.opencollective.com/graphql/v2`, {
headers: {
Expand Down
5 changes: 2 additions & 3 deletions scripts/updateContributors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ const asdf = async () => {

setData(client, newData)
} else {

if (Date.now() - JSON.parse(JSON.stringify(data)).timestamp > 3600000) {
const newData = await fetchData()
setData(client, newData)
Expand All @@ -172,7 +171,7 @@ const asdf = async () => {

try {
await asdf()
console.log("Successfully hydrated contributors.")
console.log(`Successfully hydrated contributors.`)
} catch (e: any) {
throw new Error(`Unable to hydrate contributors: ${e}\n${e.stack}`)
}
}

0 comments on commit 7165501

Please sign in to comment.