Skip to content

Commit

Permalink
Wrap article in try catch (#157)
Browse files Browse the repository at this point in the history
* chore: seo optimizations

* chore: using generate tweets instead of on the fly tweets fetch

* fix: build issue

* chore: marked view more links as external to open in new tab

* chore: changed schedule api to respect the time constants

* fix: spoof date from query param in getNow util

* fix: remove spoof date from getDateRangeValidation

* docs: update readme file

* chore: teaser page layout cleanup

* chore: added github workflow to commit empty message to trigger Vercel build under my  name

* chore: testing with repo url

* chore: testing with repo owner logic

* chore: synced schedule dates

* chore: update footer design + layout

* feat: replace next-image with img to avoid caching issues

* empty commit

* feat: restructure validation logic to support zora and external, external unfinished

* feat: show max per user mint in button message

* feat: refactor to enable zora write tx

* feat: allow zora native minting

* fix: sync useValidate

* feat: add zora test mint

* feat: new crossmint id

* fix: crossmint working with zora

* empty commit

* chore: add links to footer

* chore: undo mobile nav styles

* chore: implement new mobile nav design

* fix: top margin for community

Signed-off-by: Arpit Srivastava <[email protected]>

* empty commit

* fix: padding issue

Signed-off-by: Arpit Srivastava <[email protected]>

* empty commit

* feat: remove console.log

* fix: lint fixes on add-zora branch

* feat: make address pill an external link

* fix: schedule issue

* empty commit

* feat: replace next-image with img to avoid caching issues

* feat: remove console.log

* empty commit

* empty commit

* fix: schedule issue

* feat: restructure validation logic to support zora and external, external unfinished

* feat: show max per user mint in button message

* feat: refactor to enable zora write tx

* feat: allow zora native minting

* fix: sync useValidate

* feat: add zora test mint

* feat: new crossmint id

* fix: crossmint working with zora

* empty commit

* fix: lint fixes on add-zora branch

* feat: add zora contract to test-contracts and add minttype

* fix: fix base config for testnet

* chore: update footer links

* feat: typography styles

* chore: add featured title community page

* feat: custom typography responsive

* chore: fix nav button sizing

* feat: trending page layout

* chore: changed mobile navbar globally

* fix: banner icon to be used in past and upcoming both

* chore: redirect to live stream from /live path

* chore: added anirud-samala in git workflow

* feat: mint analytics events

* fix: undo change

* fix: undo change from other repo

* empty commit

* chore: update tending page and component designs

* empty commit

* chore: fix trending page top spacing

* chore: fix partnerhero position on home page

* chore: remove empty space

* feat: new images on community page, make clickable

* empty commit

* chore: fix PageContainer logic

* empty commit

* feat: use mintWithRewards for zora

* feat: update zora test contracts

* empty commit

* chore: base banner image updated

* chore: undo page container changes

* fix: twitter module null error

* chore: not writing to file if no data is returned

* chore: silent failure

* chore: partially updated schedule

* chore: deleting file only when writing to it

* feat: button using base text size and disabled state

* chore: made tweet cards clickable

* chore: updated schedule partners and base contract

* empty commit

* chore: work

* chore: empty commit

* chore: base config update

* feat: add checking for home page, fix partnerhero placement

* fix: add check for window obj

* fix: catch user rejected request on mint dot fun mint

* empty commit

* chore: dummy arweave ID for testing

* feat: navbar typography and layout fixes

* chore: base day one config

* empty commit

* chore: change base day one to aug 9

* feat: page layout

* chore: clamping to nearest work

* chore: updated tweets file

* feat: make mint.fun clickable

* chore: added spacing and took away dollar sign from community grant section

* empty commit

* feat: mobile nav fixed

* feat: not found typography

* chore: added spacing between total and number

* feat: partner hero typography

* feat: restyle arweve component

* feat: trending and drop card typographies

* feat: trending and tabs typography

* fix: add more spacing

Signed-off-by: Arpit Srivastava <[email protected]>

* empty commit

* feat: community page typography

* chore: add new icon for base

* chore: updated community start and end dates

* empty message

* feat: add prop house

Signed-off-by: Arpit Srivastava <[email protected]>

* empty commit

* empty commit

* empty commit

* fix: remove color from typography

* chore: update arweave for base day one and partner descriptions

* chore: add dev arweave for base day one

* empty commit

* feat: mobile nav layout shift fix

* feat: mint dialog typography

* feat: remove commented old layout

* empty commit

* chore: base day one completely separate

* feat: use tailwind prose for article

* chore: updated description of partners based on the execution tracker sheet

* feat: line clamp on calendar card description

* chore: changed contract address

* chore: actioned column X of the tracker sheet

* empty commit

* empty commit

* chore: actioned brand color and name for base day one

* chore: changed

* fix: wrap article fetching in try/catch

---------

Signed-off-by: Arpit Srivastava <[email protected]>
Co-authored-by: Azim Ahmed <[email protected]>
Co-authored-by: Djordje <[email protected]>
Co-authored-by: wilsoncusack <[email protected]>
Co-authored-by: Azim Ahmed <[email protected]>
Co-authored-by: Wilson Cusack <[email protected]>
Co-authored-by: Arpit Srivastava <[email protected]>
Co-authored-by: Lukas Rosario <[email protected]>
Co-authored-by: AshishYelekar <[email protected]>
  • Loading branch information
9 people authored Aug 9, 2023
1 parent a89e5ae commit 5747ddf
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 23 deletions.
25 changes: 13 additions & 12 deletions src/app/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,20 +159,21 @@ async function getPartner(slug: string, spoofDate?: string) {
return notFound()
}

const digest = await SDK.GetMirrorTransactions({
digest: partner.aarweaveDigest,
})

const articleId = digest?.transactions?.edges[0]?.node?.id

let article = null

if (articleId) {
const res = await fetch(`https://arweave.net/${articleId}`)
article = (await res?.json()) as {
content: { body: string; title: string }
try {
const digest = await SDK.GetMirrorTransactions({
digest: partner.aarweaveDigest,
})

const articleId = digest?.transactions?.edges[0]?.node?.id

if (articleId) {
const res = await fetch(`https://arweave.net/${articleId}`)
article = (await res?.json()) as {
content: { body: string; title: string }
}
}
}
} catch {}

return { partner, article }
}
Expand Down
23 changes: 12 additions & 11 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -208,20 +208,21 @@ async function getPageData(spoofDate?: string) {
}
}, INITIAL_TABS)

const digest = await SDK.GetMirrorTransactions({
digest: featuredPartner.aarweaveDigest,
})

const articleId = digest?.transactions?.edges[0]?.node?.id

let article = null
try {
const digest = await SDK.GetMirrorTransactions({
digest: featuredPartner.aarweaveDigest,
})

if (articleId) {
const res = await fetch(`https://arweave.net/${articleId}`)
article = (await res?.json()) as {
content: { body: string; title: string }
const articleId = digest?.transactions?.edges[0]?.node?.id

if (articleId) {
const res = await fetch(`https://arweave.net/${articleId}`)
article = (await res?.json()) as {
content: { body: string; title: string }
}
}
}
} catch {}

const tweets = await getTweets()

Expand Down

0 comments on commit 5747ddf

Please sign in to comment.