Skip to content
This repository was archived by the owner on Apr 17, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/client/StatsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ const StatsPage = () => {
fontWeight="semibold"
>
<NumericDisplay
value={item.value || 0}
value={item.value}
prefix={valuePrefix}
isFetched={isFetched}
isFailedToFetchData={isFailedToFetchData}
Expand Down
6 changes: 1 addition & 5 deletions src/pages/api/social-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,12 @@ export default async function handler(
},
}

const redditResponse = await fetch(
'https://www.reddit.com/r/everipedia/about.json',
)
const twitterResponse = await fetch(url, options)

const { followers_count: twitterFollowers } = await twitterResponse.json()
const redditData = await redditResponse.json()

const data = {
twitterFollowers,
redditFollowers: redditData.data.subscribers,
}

setCacheHeaders(res)
Expand Down
8 changes: 6 additions & 2 deletions src/utils/stats-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -329,12 +329,16 @@ const getEpData = async () => {

const getSocialData = async () => {
try {
const redditResponse = await fetch(
'https://www.reddit.com/r/everipedia/about.json',
)
const twitterResponse = await fetch('/api/social-data')
const { twitterFollowers, redditFollowers } = await twitterResponse.json()
const { twitterFollowers } = await twitterResponse.json()
const redditData = await redditResponse.json()
return {
social: {
twitter: twitterFollowers,
reddit: redditFollowers,
reddit: redditData.data.subscribers,
},
}
} catch (err) {
Expand Down
Loading