Skip to content

Commit

Permalink
Merge branch 'tableland-ratelimit' into thirdwebV5-migration-citizen
Browse files Browse the repository at this point in the history
  • Loading branch information
namedotget committed Jan 17, 2025
2 parents 87e5c29 + eb55c9a commit 22ac97b
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 12 deletions.
6 changes: 4 additions & 2 deletions ui/pages/map.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ export default function NetworkMap({
<section id="map-container" className="overflow-hidden">
<Head
title={'Map'}
description={"Discover the global reach of the Space Acceleration Network on our interactive 3D map! Explore the locations of our citizens worldwide and see how we're connecting space enthusiasts across the planet."}
description={
"Discover the global reach of the Space Acceleration Network on our interactive 3D map! Explore the locations of our citizens worldwide and see how we're connecting space enthusiasts across the planet."
}
image="https://ipfs.io/ipfs/Qmc1FsD9pCw3FoYEQ1zviqXc3DQddyxte6cQ8hv6EvukFr"
/>
<Container>
Expand Down Expand Up @@ -112,7 +114,7 @@ export async function getStaticProps() {
const filteredValidCitizens = citizens.filter(async (c: any) => {
const now = Math.floor(Date.now() / 1000)
const expiresAt = await citizenContract.call('expiresAt', [c.metadata.id])
const view = getAttribute(c.metadata.attributes, 'view').value
const view = getAttribute(c?.metadata?.attributes, 'view').value
return (
expiresAt.toNumber() > now &&
view === 'public' &&
Expand Down
36 changes: 26 additions & 10 deletions ui/pages/network.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -305,12 +305,20 @@ export async function getStaticProps() {
})

const teams: any = []
async function fetchTeam(tokenId: number) {
try {
const team = await getNFT({
contract: teamContract,
tokenId: BigInt(tokenId),
})
teams.push(team)
} catch (err) {
console.error(err)
}
}
for (let i = 0; i < totalTeams; i++) {
const team = await getNFT({
contract: teamContract,
tokenId: BigInt(i),
})
teams.push(team)
await new Promise((resolve) => setTimeout(resolve, 200))
await fetchTeam(i)
}

const filteredPublicTeams: any = teams?.filter(
Expand Down Expand Up @@ -364,12 +372,20 @@ export async function getStaticProps() {
})

const citizens: any = []
async function fetchCitizen(tokenId: number) {
try {
const citizen = await getNFT({
contract: citizenContract,
tokenId: BigInt(tokenId),
})
citizens.push(citizen)
} catch (err) {
console.error(err)
}
}
for (let i = 0; i < totalCitizens; i++) {
const citizen = await getNFT({
contract: citizenContract,
tokenId: BigInt(i),
})
citizens.push(citizen)
await new Promise((resolve) => setTimeout(resolve, 200))
await fetchCitizen(i)
}

const filteredPublicCitizens: any = citizens?.filter(
Expand Down

0 comments on commit 22ac97b

Please sign in to comment.